feat: add edit employee component (#604)

Fixes: #581
This commit is contained in:
Ashutosh Sharma
2020-05-13 08:17:32 +05:30
committed by GitHub
parent 389eb5edd2
commit 17cab17d0b
9 changed files with 268 additions and 9 deletions
+13 -3
View File
@@ -76,10 +76,12 @@ export class OrganizationService {
/**
* @param {string} employeeId Employee ID of employee.
* @param {boolean} template
* @returns {Observable<any>} Employee.
*/
getEmployee(employeeId: string): Observable<any> {
return this.http.get(`/staff/${employeeId}`);
getEmployee(employeeId: string, template: boolean = true): Observable<any> {
const httpParams = new HttpParams().set('template', template.toString());
return this.http.get(`/staff/${employeeId}`, { params: httpParams });
}
/**
@@ -246,7 +248,7 @@ export class OrganizationService {
return this.http.put('/workingdays', workingDays);
}
/*
/**
* @param {string} officeId Office ID of Holidays.
* @returns {Observable<any>} Holidays data.
*/
@@ -256,4 +258,12 @@ export class OrganizationService {
return this.http.get('/holidays', { params: httpParams });
}
/**
* @param {any} employeeId Employee ID of Employee to be edited.
* @returns {Observable<any>}
*/
updateEmployee(employeeId: string, employee: any): Observable<any> {
return this.http.put(`/staff/${employeeId}`, employee);
}
}