* activate holidays

* issue1317 add correct route

* tslint bugs are fixed

merging based on @BLasan  approval, thanks Benura and @gustavao
This commit is contained in:
Gustavo Espíndola
2021-08-05 15:10:13 +05:30
committed by GitHub
parent 5bfcfc8fea
commit c382867813
4 changed files with 121 additions and 92 deletions
+24 -13
View File
@@ -93,8 +93,8 @@ export class OrganizationService {
*/
getOfficerTemplate(officerId: string, officeId: string): Observable<any> {
const httpParams = new HttpParams()
.set('fromLoanOfficerId', officerId.toString())
.set('officeId', officerId.toString());
.set('fromLoanOfficerId', officerId.toString())
.set('officeId', officerId.toString());
return this.http.get('/loans/loanreassignment/template', { params: httpParams });
}
@@ -134,9 +134,9 @@ export class OrganizationService {
return this.http.put(`/offices/${officeId}`, office);
}
/**
* @returns {Observable<any>}
*/
/**
* @returns {Observable<any>}
*/
getOfficeDatatables(): Observable<any> {
const httpParams = new HttpParams().set('apptable', 'm_office');
return this.http.get(`/datatables`, { params: httpParams });
@@ -222,7 +222,7 @@ export class OrganizationService {
* @returns {Observable<any>} Currencies data
*/
updateCurrencies(currencies: any[]): Observable<any> {
return this.http.put('/currencies', {currencies});
return this.http.put('/currencies', { currencies });
}
/**
@@ -431,7 +431,7 @@ export class OrganizationService {
*/
settleCash(tellerId: string, cashierId: string, cashData: any): Observable<any> {
const httpParams = new HttpParams().set('command', 'settle');
return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/settle`, cashData, {params: httpParams});
return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/settle`, cashData, { params: httpParams });
}
/**
@@ -442,7 +442,7 @@ export class OrganizationService {
*/
allocateCash(tellerId: string, cashierId: string, cashData: any): Observable<any> {
const httpParams = new HttpParams().set('command', 'allocate');
return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/allocate`, cashData, {params: httpParams});
return this.http.post(`/tellers/${tellerId}/cashiers/${cashierId}/allocate`, cashData, { params: httpParams });
}
/** Get Cashier Template.
@@ -639,6 +639,17 @@ export class OrganizationService {
return this.http.delete(`/holidays/${holidayId}`);
}
/**
* Activate Holiday.
* @param holidayId Holiday Id to be deleted.
* @returns {Observable<any>} Resource Id.
*/
activateHoliday(holidayId: string): Observable<any> {
const httpParams = new HttpParams()
.set('command', 'activate');
return this.http.post(`/holidays/${holidayId}`, null, { params: httpParams });
}
/**
* @param {any} employeeId Employee ID of Employee to be edited.
* @returns {Observable<any>}
@@ -695,7 +706,7 @@ export class OrganizationService {
*/
getImports(entity: string): Observable<any> {
const httpParams = new HttpParams().set('entityType', entity);
return this.http.get('/imports', { params: httpParams } );
return this.http.get('/imports', { params: httpParams });
}
/**
@@ -754,7 +765,7 @@ export class OrganizationService {
if (legalFormType.length) {
httpParams = httpParams.set('legalFormType', legalFormType);
}
return this.http.get(`${urlSuffix}/downloadtemplate`, { params: httpParams, responseType: 'arraybuffer', observe: 'response'} );
return this.http.get(`${urlSuffix}/downloadtemplate`, { params: httpParams, responseType: 'arraybuffer', observe: 'response' });
}
/**
@@ -764,8 +775,8 @@ export class OrganizationService {
getImportDocument(id: any): Observable<any> {
const httpParams = new HttpParams()
.set('importDocumentId', id)
.set('tenantIdentifier', 'default' );
return this.http.get('/imports/downloadOutputTemplate', { params: httpParams, responseType: 'arraybuffer', observe: 'response'});
.set('tenantIdentifier', 'default');
return this.http.get('/imports/downloadOutputTemplate', { params: httpParams, responseType: 'arraybuffer', observe: 'response' });
}
/**
@@ -783,7 +794,7 @@ export class OrganizationService {
formData.append('file', file);
formData.append('locale', this.settingsService.language.code);
formData.append('dateFormat', this.settingsService.dateFormat);
return this.http.post(`${urlSuffix}/uploadtemplate`, formData , { params: httpParams } );
return this.http.post(`${urlSuffix}/uploadtemplate`, formData, { params: httpParams });
}
}