This commit is contained in:
tiago.kayaya
2021-09-15 09:33:13 +01:00
parent fb5d7d797c
commit 90e0ee62fa
6 changed files with 98 additions and 70 deletions
+33 -5
View File
@@ -412,7 +412,7 @@ export class EventsService {
return this.http.post<string>(`${puturl}`, event, options)
}
deleteEvent(eventid:string, eventDeleteType:number)
deleteEvent(eventid:string, eventDeleteType:number, calendarName:string)
{
const puturl = environment.apiURL + 'calendar/DeleteEvent';
let params = new HttpParams();
@@ -421,10 +421,38 @@ export class EventsService {
// 0 for occurence and 1 for serie (delete all events)
params = params.set("eventDeleteType", eventDeleteType.toString());
let options = {
headers: this.headers,
params: params
};
let options;
switch (this.loggeduser.Profile) {
case 'MDGPR':
if(calendarName == 'Pessoal'){
options = {
headers: this.headersMdPessoal,
params: params
};
}
else if(calendarName == 'Oficial'){
options = {
headers: this.headersMdOficial,
params: params
};
}
break;
case 'PR':
if(calendarName == 'Pessoal'){
options = {
headers: this.headersPrPessoal,
params: params
};
}
else if(calendarName == 'Oficial'){
options = {
headers: this.headersPrOficial,
params: params
};
}
break;
}
return this.http.delete(`${puturl}`, options)
}