mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
fix update
This commit is contained in:
@@ -458,20 +458,22 @@ export class EditEventPage implements OnInit {
|
||||
const calendar = await this.agendaDataRepository.getCalendarByUserId(this.selectedUserCalendar)
|
||||
|
||||
if(calendar.isOk()) {
|
||||
const _value = this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, this.editAllEvent, calendar.value, tracing)//.subscribe((value) => {
|
||||
const _value = await this.agendaDataRepository.updateEvent(this.postEvent.EventId, this.postEvent, this.editAllEvent, calendar.value, tracing)//.subscribe((value) => {
|
||||
|
||||
_value.then((value) => {
|
||||
if(value.isOk()) {
|
||||
console.log(value.value)
|
||||
this.close();
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
} else {
|
||||
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
console.log('edit event error: ', value.error)
|
||||
}
|
||||
})
|
||||
|
||||
// _value.then((value) => {
|
||||
// if(value.isOk()) {
|
||||
// console.log(value.value)
|
||||
// this.close();
|
||||
// this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
// tracing.setAttribute('outcome', 'success')
|
||||
// } else {
|
||||
|
||||
// tracing.setAttribute('outcome', 'failed')
|
||||
// console.log('edit event error: ', value.error)
|
||||
// }
|
||||
// })
|
||||
|
||||
console.log({serverCurrentList: this.serverCurrentList, Attendees: this.postEvent.Attendees})
|
||||
|
||||
@@ -479,42 +481,79 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
console.log({insert, remove })
|
||||
if(insert.length >= 1) {
|
||||
this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
|
||||
try {
|
||||
await this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert, tracing).toPromise()
|
||||
} catch (error) {
|
||||
tracing.setAttribute('failed.attendees', 'true')
|
||||
console.log('add Attendee error: ', error)
|
||||
}));
|
||||
}
|
||||
|
||||
// this.agendaDataRepository.addEventAttendee(this.postEvent.EventId, insert, tracing).subscribe((value) => {
|
||||
// console.log(value)
|
||||
// }, ((error) => {
|
||||
// tracing.setAttribute('failed.attendees', 'true')
|
||||
// console.log('add Attendee error: ', error)
|
||||
// }));
|
||||
|
||||
}
|
||||
|
||||
if(remove.length >= 1) {
|
||||
|
||||
this.agendaDataRepository.removeEventAttendee(this.postEvent.EventId, remove).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
try {
|
||||
await this.agendaDataRepository.removeEventAttendee(this.postEvent.EventId, remove).toPromise();
|
||||
} catch (error) {
|
||||
tracing.setAttribute('failed.attendees', 'true')
|
||||
console.log('add Attendee error: ', error)
|
||||
}));
|
||||
}
|
||||
|
||||
// this.agendaDataRepository.removeEventAttendee(this.postEvent.EventId, remove).subscribe((value) => {
|
||||
// console.log(value)
|
||||
// }, ((error) => {
|
||||
// tracing.setAttribute('failed.attendees', 'true')
|
||||
// console.log('add Attendee error: ', error)
|
||||
// }));
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (this.addedAttachmentsList.length > 0) {
|
||||
this.agendaDataRepository.addEventAttachment(this.postEvent.EventId, this.loadedEventAttachments, tracing).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
try {
|
||||
await this.agendaDataRepository.addEventAttachment(this.postEvent.EventId, this.loadedEventAttachments, tracing).toPromise();
|
||||
} catch (error) {
|
||||
console.log('add attachment error: ', error)
|
||||
}));
|
||||
}
|
||||
|
||||
// this.agendaDataRepository.addEventAttachment(this.postEvent.EventId, this.loadedEventAttachments, tracing).subscribe((value) => {
|
||||
// console.log(value)
|
||||
// }, ((error) => {
|
||||
// console.log('add attachment error: ', error)
|
||||
// }));
|
||||
}
|
||||
|
||||
if (this.deletedAttachmentsList.length > 0) {
|
||||
this.agendaDataRepository.removeEventAttachment(this.postEvent.EventId, { attachments: this.deletedAttachmentsList }).subscribe((value) => {
|
||||
console.log(value)
|
||||
}, ((error) => {
|
||||
try {
|
||||
await this.agendaDataRepository.removeEventAttachment(this.postEvent.EventId, { attachments: this.deletedAttachmentsList }).toPromise()
|
||||
} catch (error) {
|
||||
console.log('remove attachment error: ', error)
|
||||
tracing.setAttribute('failed.remove.attachment', 'true')
|
||||
}));
|
||||
}
|
||||
|
||||
// this.agendaDataRepository.removeEventAttachment(this.postEvent.EventId, { attachments: this.deletedAttachmentsList }).subscribe((value) => {
|
||||
// console.log(value)
|
||||
// }, ((error) => {
|
||||
// console.log('remove attachment error: ', error)
|
||||
// tracing.setAttribute('failed.remove.attachment', 'true')
|
||||
// }));
|
||||
}
|
||||
|
||||
if(_value.isOk()) {
|
||||
console.log(_value.value)
|
||||
this.close();
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
tracing.setAttribute('outcome', 'success')
|
||||
} else {
|
||||
tracing.setAttribute('outcome', 'failed')
|
||||
console.log('edit event error: ', _value.error)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user