diff options
| author | Tusooa Zhu <tusooa@kazv.moe> | 2022-03-17 15:07:04 -0400 |
|---|---|---|
| committer | tusooa <tusooa@kazv.moe> | 2022-11-24 18:27:14 -0500 |
| commit | e877fedb0e60e795bd5c6aa3e706c64f12746c66 (patch) | |
| tree | b5cc74979ead76afaf6f917a8179bd91dbf4eb30 /src/components/announcement/announcement.js | |
| parent | efb76dcb038eebca5255398ee2ae994dac9c5e95 (diff) | |
Implement deleting announcement
Diffstat (limited to 'src/components/announcement/announcement.js')
| -rw-r--r-- | src/components/announcement/announcement.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components/announcement/announcement.js b/src/components/announcement/announcement.js index 9e043e48..b1f5ee77 100644 --- a/src/components/announcement/announcement.js +++ b/src/components/announcement/announcement.js @@ -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) } } } |
