mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix sayings
This commit is contained in:
@@ -11,6 +11,7 @@ import { catchError } from "rxjs/operators";
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { calendarInterface } from '../models/user.model';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@@ -306,6 +307,22 @@ export class EventsService {
|
||||
}
|
||||
|
||||
|
||||
DetectCalendars(CalendarId) {
|
||||
const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars)
|
||||
return calendars.find((e) => e.CalendarId == CalendarId)
|
||||
}
|
||||
|
||||
makeHeader(calendar: calendarInterface) {
|
||||
let header = new HttpHeaders();
|
||||
header = header.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
header = header.set('CalendarId', calendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
header = header.set('CalendarName', calendar.CalendarName);
|
||||
|
||||
return header
|
||||
}
|
||||
|
||||
|
||||
isMyCalendar(CalendarId) {
|
||||
return this.myCalendarNames[CalendarId] || ""
|
||||
}
|
||||
@@ -672,23 +689,14 @@ export class EventsService {
|
||||
return this.http.get<Event>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
|
||||
genericGetEvent(eventid: string, calendarId: string) {
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
|
||||
const headers = [
|
||||
this.headerSharedOficial,
|
||||
this.headerSharedPessoal,
|
||||
this.headerOwnPessoal,
|
||||
this.headerOwnOficial
|
||||
]
|
||||
|
||||
const header = headers.find((header)=> {
|
||||
return header?.get('CalendarId')?.includes(calendarId)
|
||||
})
|
||||
const calendar = this.DetectCalendars(calendarId)
|
||||
const header = this.makeHeader(calendar)
|
||||
|
||||
if(header) {
|
||||
let options = {
|
||||
@@ -867,17 +875,8 @@ export class EventsService {
|
||||
|
||||
let options: any;
|
||||
|
||||
const Selectedcalendar = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars).find((calendar) =>{
|
||||
return calendar.CalendarId == CalendarId
|
||||
})
|
||||
|
||||
let header = new HttpHeaders();
|
||||
|
||||
header = header.set('Authorization',SessionStore.user.BasicAuthKey);
|
||||
header = header.set('CalendarId', Selectedcalendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', Selectedcalendar.CalendarRoleId);
|
||||
|
||||
// console.log(Selectedcalendar)
|
||||
const calendar = this.DetectCalendars(CalendarId)
|
||||
const header = this.makeHeader(calendar)
|
||||
|
||||
options = {
|
||||
headers: header,
|
||||
|
||||
Reference in New Issue
Block a user