fix ownertype and category type

This commit is contained in:
Peter Maquiran
2024-06-21 23:33:29 +01:00
parent 558810ab83
commit 0c14b9be97
13 changed files with 90 additions and 531 deletions
@@ -157,7 +157,7 @@ export class AgendaDataRepositoryService {
}
createEvent(eventData: Event, documents, calendar: TableSharedCalendar) {
console.log('create repository 1',eventData)
console.log('create repository 1',eventData, calendar)
let eventInput = {
userId: calendar.wxUserId,
@@ -211,6 +211,8 @@ export class AgendaDataRepositoryService {
}
}
console.log({eventData})
return this.agendaDataService.updateEvent(eventId, eventInput)
}
+14 -9
View File
@@ -26,13 +26,13 @@ export class Utils {
}
}
selectedCalendarOwner(CalendarName) {
let selectedCalendar = this.findRoleIdByUserId(this.eventService.calendarNamesAry, CalendarName);
console.log('selected', selectedCalendar )
if (selectedCalendar) {
if (selectedCalendar == "Presidente da República") {
selectedCalendarOwner(roleDescription) {
console.log('roleDescription', roleDescription)
if (roleDescription) {
if (roleDescription == "Presidente da República") {
return 1;
} else if (selectedCalendar == "Ministro e Director do Gabinete do PR") {
} else if (roleDescription == "Ministro e Director do Gabinete do PR") {
return 2
} else {
return 3
@@ -50,7 +50,7 @@ export class Utils {
return 'other';
}
}
}
@@ -60,6 +60,11 @@ export class Utils {
'Oficial': 1,
'Pessoal': 2
}
if(calendarName != 'Pessoal' && calendarName != 'Oficial') {
throw('bad logic')
}
return selectedCalendar[calendarName];
}
@@ -180,11 +185,11 @@ export class Utils {
addOneHourToIsoString(isoDateString) {
let date = new Date(isoDateString);
const tzOffset = -date.getTimezoneOffset(); // in minutes
const diff = tzOffset >= 0 ? '+' : '-';
const pad = (n: number) => (n < 10 ? '0' : '') + n;
return date.getFullYear() +
'-' + pad(date.getMonth() + 1) +
'-' + pad(date.getDate()) +