Implement deleting announcement

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

View file

@ -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)
}
}
}