mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Improve
This commit is contained in:
@@ -26,31 +26,28 @@ export class EventsService {
|
||||
headersSharedPessoal: HttpHeaders;
|
||||
//lastloadedevent: Event;
|
||||
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
this.loggeduser = user.ValidatedUser;
|
||||
|
||||
this.headersMdOficial = new HttpHeaders();
|
||||
this.headersMdPessoal = new HttpHeaders();
|
||||
|
||||
|
||||
this.headersPrOficial = new HttpHeaders();
|
||||
this.headersPrPessoal = new HttpHeaders();
|
||||
|
||||
this.headersSharedOficial = new HttpHeaders();
|
||||
this.headersSharedPessoal = new HttpHeaders();
|
||||
|
||||
|
||||
|
||||
if(this.loggeduser){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
||||
if(calendar.CalendarName == 'Oficial') {
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdOficial = this.headersMdOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if(calendar.CalendarName == 'Pessoal'){
|
||||
else if(calendar.CalendarName == 'Pessoal') {
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
@@ -58,21 +55,20 @@ export class EventsService {
|
||||
}
|
||||
});
|
||||
|
||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar =>{
|
||||
if(sharedCalendar.CalendarName == 'Oficial'){
|
||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
|
||||
if(sharedCalendar.CalendarName == 'Oficial') {
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
else if(sharedCalendar.CalendarName == 'Pessoal'){
|
||||
else if(sharedCalendar.CalendarName == 'Pessoal') {
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
@@ -80,7 +76,7 @@ export class EventsService {
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrOficial = this.headersPrOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
}
|
||||
else if(calendar.CalendarName == 'Pessoal'){
|
||||
else if(calendar.CalendarName == 'Pessoal') {
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
Reference in New Issue
Block a user