Merge pull request #57 in TEA/dafa-web-monorepo from feature/TV-351 to develop
Squashed commit of the following: commit 7009ec6cae0768d134f7dff5da8d00e047ab91de Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Thu Aug 19 13:14:22 2021 +0200 TV-351 added aria-label to delete button commit 27380c4aa24b550af0d37dc694072d7a2b1591b2 Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Thu Aug 19 07:22:09 2021 +0200 TV-351 changed icon, observable for selected employee commit 45fd5248534e0738cf2242bb60f4ac7f75accf64 Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 17:58:09 2021 +0200 TV-351 corr commit b8ac397712f3359495d463740b6fb97f6a8bfb0c Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 17:49:31 2021 +0200 TV-351 added takeUntil operator for unsubscription commit da328d66a9331aa7f7c901b939d826025401c721 Merge: 69cae6fffeb372Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 17:34:46 2021 +0200 Merge branch 'develop' into feature/TV-351 commit 69cae6f711c60959edff48709e2fa99ba4534c65 Merge: ed57d7db7c7b6bAuthor: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 12:58:45 2021 +0200 Merge branch 'develop' into feature/TV-351 commit ed57d7d35e132f90f374b465ffdbf507c55f4038 Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 12:54:22 2021 +0200 TV-351 prev pr review fix commit eca6211388ea20c0aba9980dd4343163e54d51eb Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 12:49:19 2021 +0200 TV-351 delete employee commit 206bf42a9a952d2e74bb60ad4a12c2f0568cb100 Merge: 0d2700f218e3d6Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Wed Aug 18 08:41:23 2021 +0200 Merge branch 'develop' into feature/TV-351 commit 0d2700f1fc535d6afcddbe2bfed68ff775b3d0ea Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Tue Aug 17 15:15:23 2021 +0200 TV-351 add letter s if fullName ends without s commit ff0d2631f45979d6381d409e119933f48b35d852 Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Tue Aug 17 14:18:23 2021 +0200 TV-351 delete method in service, waiting for api commit 2f1edd6e70c83b90ad6fe6399af5ef5ddf294152 Author: fueno <nicolas.fuentes-maturana@arbetsformedlingen.se> Date: Tue Aug 17 14:16:38 2021 +0200 TV-351 delete employee
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export interface DeleteEmployeeMockApiResponse {
|
||||
status: number;
|
||||
message: string;
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { ErrorType } from '@msfa-enums/error-type.enum';
|
||||
import { SortOrder } from '@msfa-enums/sort-order.enum';
|
||||
import { environment } from '@msfa-environment';
|
||||
import { EmployeeInviteMockApiResponse } from '@msfa-models/api/employee-invite.response.model';
|
||||
import { DeleteEmployeeMockApiResponse } from '@msfa-models/api/delete-employee.response.model';
|
||||
import {
|
||||
EmployeeCompactResponse,
|
||||
EmployeeResponse,
|
||||
@@ -97,6 +98,22 @@ export class EmployeeService {
|
||||
this._onlyEmployeesWithoutAuthorization$.next(value);
|
||||
}
|
||||
|
||||
// Not done, waiting for delete api http response
|
||||
public deleteEmployee(id: string): Observable<any> {
|
||||
return this.httpClient
|
||||
.delete<DeleteEmployeeMockApiResponse>(`${this._apiUrl}/${id}`, { ...API_HEADERS })
|
||||
.pipe(
|
||||
take(1),
|
||||
map(response => {
|
||||
return {
|
||||
status: response.status || 200, // mockresponse
|
||||
message: response.message || 'deleted succeeded' // mockresponse
|
||||
}
|
||||
}),
|
||||
catchError(error => throwError({ message: error as string, type: ErrorType.API }))
|
||||
);
|
||||
}
|
||||
|
||||
public setSort(newSortKey: keyof EmployeeCompactResponse): void {
|
||||
const currentSort = this._sort$.getValue();
|
||||
const order =
|
||||
|
||||
Reference in New Issue
Block a user