Changes to some models and data coming from API
This commit is contained in:
@@ -50,12 +50,16 @@ export class AvropApiService {
|
||||
|
||||
this._lockedAvropSnapshot$.next(avrop);
|
||||
|
||||
return this.httpClient.get<{ data: HandledareResponse[] }>(`${this._apiBaseUrl}/handledare`).pipe(
|
||||
map(({ data }) => data.map(handledare => mapHandledareResponseToHandledare(handledare))),
|
||||
tap(handledare => {
|
||||
this._availableHandledareSnapshot$.next(handledare);
|
||||
return this.httpClient
|
||||
.get<{ data: HandledareResponse[] }>(`${this._apiBaseUrl}/handledare`, {
|
||||
params: { avropIds: avrop.map(a => a.id) },
|
||||
})
|
||||
);
|
||||
.pipe(
|
||||
map(({ data }) => data.map(handledare => mapHandledareResponseToHandledare(handledare))),
|
||||
tap(handledare => {
|
||||
this._availableHandledareSnapshot$.next(handledare);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
fetchAvailableTjanster$(params: Params): Observable<AvropTjanst[]> {
|
||||
|
||||
@@ -190,15 +190,17 @@ export class EmployeeService extends UnsubscribeDirective {
|
||||
}
|
||||
|
||||
public updateEmployeeData(employeeData: Employee): Observable<string> {
|
||||
return /* this.httpClient.put<{ id: string }>(`${this._apiBaseUrl}/${employeeData.id}`,
|
||||
return; /* this.httpClient.put<{ id: string }>(`${this._apiBaseUrl}/${employeeData.id}`,
|
||||
mapEmployeeToRequestData(employeeData), API_HEADERS).pipe(
|
||||
map(({ id }) => id),
|
||||
catchError(error => throwError({ message: error as string, type: ErrorType.API }))
|
||||
); */
|
||||
}
|
||||
|
||||
public getAllRoles(): Role[] {
|
||||
const allAuths: string[] = Object.keys(RoleEnum).filter((item) => {return isNaN(Number(item))});
|
||||
return allAuths.map(key => mapRoleResponseToRoleObject(key));
|
||||
public get allRoles(): Role[] {
|
||||
const allAuths: string[] = Object.keys(RoleEnum).filter(item => {
|
||||
return isNaN(Number(item));
|
||||
});
|
||||
return allAuths.map(key => mapRoleResponseToRoleObject(key));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user