ITOTEAM-594 Implementar o endpoint de listagem do tipo de agenda

This commit is contained in:
Peter Maquiran
2024-06-24 16:08:20 +01:00
parent 93476dc5c4
commit 76ff62d428
6 changed files with 80 additions and 110 deletions
@@ -698,26 +698,21 @@ export class EditEventPage implements OnInit {
}
changeAgenda() {
async changeAgenda() {
setTimeout(() => {
const result = await this.agendaDataRepository.geCalendars()
if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial'] && this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) {
const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar)
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
} else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial']) {
if(selectedCalendar) {
if(selectedCalendar.shareType == 1) {
this.CalendarNamesOptions = ['Oficial']
this.postEvent.CalendarName = 'Oficial'
} else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) {
} else if(selectedCalendar.shareType == 2) {
this.CalendarNamesOptions = ['Pessoal']
this.postEvent.CalendarName = 'Pessoal'
} else {
} else if (selectedCalendar.shareType == 3) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
}
}, 50)
}
}
@@ -537,26 +537,21 @@ export class NewEventPage implements OnInit {
}
}
changeAgenda() {
async changeAgenda() {
setTimeout(() => {
const result = await this.agendaDataRepository.geCalendars()
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar)
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
if(selectedCalendar) {
if(selectedCalendar.shareType == 1) {
this.CalendarNamesOptions = ['Oficial']
this.postEvent.CalendarName = 'Oficial'
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
} else if(selectedCalendar.shareType == 2) {
this.CalendarNamesOptions = ['Pessoal']
this.postEvent.CalendarName = 'Pessoal'
} else {
} else if (selectedCalendar.shareType == 3) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
}
}, 50)
}
}