mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
owner type bug solved
This commit is contained in:
@@ -97,10 +97,9 @@ export class AgendaDataRepositoryService {
|
||||
}
|
||||
|
||||
createEvent(eventData: Event, CalendarName, documents) {
|
||||
console.log('create evetn v2',eventData)
|
||||
|
||||
let eventInput = {
|
||||
userId: this.utils.selectedCalendarUserId(CalendarName, eventData) as any,
|
||||
userId: CalendarName,
|
||||
ownerType: this.utils.selectedCalendarOwner(CalendarName),
|
||||
subject: eventData.Subject,
|
||||
body: eventData.Body.Text,
|
||||
|
||||
@@ -27,12 +27,12 @@ export class Utils {
|
||||
}
|
||||
|
||||
selectedCalendarOwner(CalendarName) {
|
||||
let selectedCalendar = this.eventService.calendarNamesType[CalendarName]?.['RoleId'];
|
||||
|
||||
let selectedCalendar = this.findRoleIdByUserId(this.eventService.calendarNamesAry, CalendarName);
|
||||
console.log('selected', selectedCalendar )
|
||||
if (selectedCalendar) {
|
||||
if (selectedCalendar.Role == 100000014) {
|
||||
if (selectedCalendar == "Presidente da República") {
|
||||
return 1;
|
||||
} else if (selectedCalendar.Role == 100000011) {
|
||||
} else if (selectedCalendar == "Ministro e Director do Gabinete do PR") {
|
||||
return 2
|
||||
} else {
|
||||
return 3
|
||||
@@ -40,6 +40,19 @@ export class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
findRoleIdByUserId(array, userId) {
|
||||
for (let item of array) {
|
||||
console.log('each item before',item)
|
||||
if (typeof item === 'object' && item !== null && item.OwnerUserId === parseInt(userId)) {
|
||||
console.log('each item after',item)
|
||||
return item.Role;
|
||||
} else {
|
||||
return 'other';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
calendarCategorySeleted(calendarName) {
|
||||
|
||||
Reference in New Issue
Block a user