Show announcement dates
This commit is contained in:
parent
ce84557190
commit
04fbb6d93d
8 changed files with 156 additions and 58 deletions
|
|
@ -28,7 +28,12 @@ const announcements = {
|
|||
mutations,
|
||||
actions: {
|
||||
fetchAnnouncements (store) {
|
||||
return store.rootState.api.backendInteractor.fetchAnnouncements()
|
||||
const currentUser = store.rootState.users.currentUser
|
||||
const isAdmin = currentUser && currentUser.role === 'admin'
|
||||
|
||||
return (isAdmin
|
||||
? store.rootState.api.backendInteractor.adminFetchAnnouncements()
|
||||
: store.rootState.api.backendInteractor.fetchAnnouncements())
|
||||
.then(announcements => {
|
||||
store.commit('setAnnouncements', announcements)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue