allow to alter agenda

This commit is contained in:
Peter Maquiran
2024-06-21 13:45:06 +01:00
parent 9ea120bfcd
commit 3b6da3d2c7
21 changed files with 1058 additions and 237 deletions
@@ -84,4 +84,24 @@ export class AgendaLocalDataSourceService {
return AgendaDataSource.shareCalendar.toArray()
}))
}
// New method to get calendars by wxUserId
async getCalendarByUserId(wxUserId: number) {
try {
const result = await AgendaDataSource.shareCalendar.get(wxUserId)
if(!result) {
const list = await AgendaDataSource.shareCalendar.toArray()
const found = list.find(e => e.wxUserId == wxUserId)
if(found) {
return ok(found)
} else {
return err('404')
}
} else {
return ok(result)
}
} catch (e) {
return err(false);
}
}
}