Implement deleting announcement
This commit is contained in:
parent
efb76dcb03
commit
e877fedb0e
4 changed files with 42 additions and 1 deletions
|
|
@ -1,9 +1,13 @@
|
|||
import { mapState } from 'vuex'
|
||||
|
||||
const Announcement = {
|
||||
props: {
|
||||
announcement: Object
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
currentUser: state => state.users.currentUser
|
||||
}),
|
||||
content () {
|
||||
return this.announcement.content
|
||||
},
|
||||
|
|
@ -16,6 +20,9 @@ const Announcement = {
|
|||
if (!this.isRead) {
|
||||
return this.$store.dispatch('markAnnouncementAsRead', this.announcement.id)
|
||||
}
|
||||
},
|
||||
deleteAnnouncement () {
|
||||
return this.$store.dispatch('deleteAnnouncement', this.announcement.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue