aboutsummaryrefslogtreecommitdiff
path: root/src/components/announcement/announcement.js
blob: 9e043e48422b0e26b4ac3810c9d2d3779d4d4756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

const Announcement = {
  props: {
    announcement: Object
  },
  computed: {
    content () {
      return this.announcement.content
    },
    isRead () {
      return this.announcement.read
    }
  },
  methods: {
    markAsRead () {
      if (!this.isRead) {
        return this.$store.dispatch('markAnnouncementAsRead', this.announcement.id)
      }
    }
  }
}

export default Announcement