Implement posting announcements

This commit is contained in:
Tusooa Zhu 2022-03-17 14:54:52 -04:00 committed by tusooa
commit e494e74643
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
4 changed files with 136 additions and 1 deletions

View file

@ -53,6 +53,12 @@ const announcements = {
const interval = store.state.fetchAnnouncementsTimer
store.commit('setFetchAnnouncementsTimer', undefined)
clearInterval(interval)
},
postAnnouncement (store, { content, startsAt, endsAt, allDay }) {
return store.rootState.api.backendInteractor.postAnnouncement({ content, startsAt, endsAt, allDay })
.then(() => {
return store.dispatch('fetchAnnouncements')
})
}
}
}