added the edit and delete event offline

This commit is contained in:
Eudes Inácio
2021-10-20 11:06:00 +01:00
parent a77fffe6f8
commit f181bd12d9
7 changed files with 163 additions and 188 deletions
+14 -2
View File
@@ -346,7 +346,7 @@ export class EventsService {
return this.http.put<Event>(`${puturl}`, event, options).pipe(
catchError(err => {
this.offlinemanager.storeRequest(puturl, 'PUT', arrayReq);
this.offlinemanager.storeRequestData('eventEdit', arrayReq);
throw new Error(err);
})
)
@@ -432,6 +432,13 @@ export class EventsService {
}
deleteEvent(eventid: string, eventDeleteType: number, calendarName: string) {
let arrayReq = [];
let Object = {
eventid: eventid,
eventDeleteType: eventDeleteType,
calendarName: calendarName
}
arrayReq.push(Object)
const puturl = environment.apiURL + 'calendar/DeleteEvent';
let params = new HttpParams();
@@ -472,7 +479,12 @@ export class EventsService {
break;
}
return this.http.delete(`${puturl}`, options)
return this.http.delete(`${puturl}`, options).pipe(
catchError(err => {
this.offlinemanager.storeRequestData('eventDelete', arrayReq);
throw new Error(err);
})
)
}
postExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) {
const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/event';