mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix agenda
This commit is contained in:
@@ -282,19 +282,19 @@ export class EventsService {
|
||||
|
||||
}
|
||||
|
||||
for (let sharedCalendar of SessionStore.user.OwnerCalendars) {
|
||||
for (let OwnerCalendar of SessionStore.user.OwnerCalendars) {
|
||||
this.hasAnyCalendar = true
|
||||
|
||||
this.calendarNames[sharedCalendar.CalendarId] = 'Meu calendario'
|
||||
this.calendarNames[OwnerCalendar.CalendarId] = 'Meu calendario'
|
||||
|
||||
if(!this.calendarNamesAry.includes('Meu calendario')) {
|
||||
this.calendarNamesAry.push('Meu calendario')
|
||||
this.calendarNamesType['Meu calendario'] = {}
|
||||
}
|
||||
|
||||
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName] = true
|
||||
this.calendarNamesType['Meu calendario'][sharedCalendar.CalendarName+'Id'] = sharedCalendar.CalendarId
|
||||
this.calendarNamesType['Meu calendario']['RoleId'] = sharedCalendar.CalendarRoleId
|
||||
this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName] = true
|
||||
this.calendarNamesType['Meu calendario'][OwnerCalendar.CalendarName+'Id'] = OwnerCalendar.CalendarId
|
||||
this.calendarNamesType['Meu calendario']['RoleId'] = OwnerCalendar.CalendarRoleId
|
||||
}
|
||||
|
||||
|
||||
@@ -525,6 +525,40 @@ export class EventsService {
|
||||
return this.http.get<any>(`${geturl}`, options)
|
||||
}
|
||||
|
||||
async getEventsByCalendarId( startdate: string, enddate: string, calendarIds: any[]) {
|
||||
const calendars = SessionStore.user.OwnerCalendars.concat(SessionStore.user.SharedCalendars)
|
||||
const agendasCalendars = calendars.filter( e => calendarIds.includes(e.CalendarId))
|
||||
|
||||
let result = []
|
||||
|
||||
for(let agendasCalendar of agendasCalendars) {
|
||||
var header = new HttpHeaders();
|
||||
header = header.set('Authorization', SessionStore.user.BasicAuthKey);
|
||||
header = header.set('CalendarId', agendasCalendar.CalendarId);
|
||||
header = header.set('CalendarRoleId', agendasCalendar.CalendarRoleId);
|
||||
header = header.set('CalendarName', agendasCalendar.CalendarName);
|
||||
|
||||
|
||||
let geturl = environment.apiURL + 'calendar/GetEvents';
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("StartDate", startdate);
|
||||
params = params.set("EndDate", enddate);
|
||||
|
||||
let options = {
|
||||
headers: header,
|
||||
params: params
|
||||
};
|
||||
|
||||
const calendar = await this.http.get<Event[]>(`${geturl}`, options).toPromise()
|
||||
|
||||
result = result.concat(calendar)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
async genericGetAllSharedEvents(startdate: string, enddate: string) {
|
||||
|
||||
let result = []
|
||||
|
||||
Reference in New Issue
Block a user