Updated disabilities api to match api
This commit is contained in:
@@ -86,10 +86,12 @@ export class DeltagareService {
|
|||||||
|
|
||||||
private _fetchDisabilities$(id: string): Observable<Disability[]> {
|
private _fetchDisabilities$(id: string): Observable<Disability[]> {
|
||||||
return this.httpClient
|
return this.httpClient
|
||||||
.get<DisabilityResponse[][]>(`${this._apiBaseUrl}/work/disability/${id}`, { ...API_HEADERS })
|
.get<{ data: DisabilityResponse[][] }>(`${this._apiBaseUrl}/work/disability/${id}`, { ...API_HEADERS })
|
||||||
.pipe(
|
.pipe(
|
||||||
map(response =>
|
map(response =>
|
||||||
response ? response[0].map(funktionsnedsattning => mapResponseToDisability(funktionsnedsattning)) : []
|
response.data.length
|
||||||
|
? response.data[0].map(funktionsnedsattning => mapResponseToDisability(funktionsnedsattning))
|
||||||
|
: []
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user