feat: add edit office component (#664) (#664)

Fixes: #662
This commit is contained in:
Benura Abeywardena
2020-05-13 01:20:15 +05:30
committed by GitHub
parent 6b69112b25
commit 7dbb24623b
9 changed files with 241 additions and 2 deletions
@@ -32,6 +32,16 @@ export class OrganizationService {
return this.http.get('/offices');
}
/**
* @param {string} officeId Office ID of Office.
* @param {boolean} template
* @returns {Observable<any>} Office.
*/
getOffice(officeId: string, template: boolean = false): Observable<any> {
const httpParams = new HttpParams().set('template', template.toString());
return this.http.get(`/offices/${officeId}`, { params: httpParams });
}
/**
* @param {any} office Office to be created.
* @returns {Observable<any>}
@@ -40,6 +50,15 @@ export class OrganizationService {
return this.http.post('/offices', office);
}
/**
* @param {any} office Office to be updated.
* @param {string} officeId Office Id
* @returns {Observable<any>}
*/
updateOffice(officeId: string, office: any): Observable<any> {
return this.http.put(`/offices/${officeId}`, office);
}
/**
* @returns {Observable<any>} Employees data
*/