mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
allow to alter agenda
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user