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
@@ -636,27 +636,21 @@ export class EditEventPage implements OnInit {
}
changeAgenda() {
async changeAgenda() {
setTimeout(() => {
console.log('selecione agenda', this.eventsService.calendarNamesType)
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)
}
}
@@ -185,6 +185,8 @@ export class NewEventPage implements OnInit {
this.selectedUserCalendar = SessionStore.user.UserId
}
this.changeAgenda()
}
}
@@ -408,34 +410,23 @@ export class NewEventPage implements OnInit {
this.hasChangeCalendar = true
}
changeAgenda() {
async changeAgenda() {
this.CalendarNameShow = false
setTimeout(() => {
const result = await this.agendaDataRepository.geCalendars()
this.CalendarNameShow = true
const selectedCalendar = result.find(e => e.wxUserId == this.selectedUserCalendar)
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
console.log(this.postEvent.CalendarName)
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
if(selectedCalendar) {
if(selectedCalendar.shareType == 1) {
this.CalendarNamesOptions = ['Oficial']
this.postEvent.CalendarName = 'Oficial'
console.log(this.postEvent.CalendarName)
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
} else if(selectedCalendar.shareType == 2) {
this.CalendarNamesOptions = ['Pessoal']
this.postEvent.CalendarName = 'Pessoal'
console.log(this.postEvent.CalendarName)
} else {
} else if (selectedCalendar.shareType == 3) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
console.log(this.postEvent.CalendarName)
}
}, 50)
}
}