17 lines
402 B
JavaScript
17 lines
402 B
JavaScript
export default {
|
|
mounted() {
|
|
this.checkMessages()
|
|
},
|
|
methods: {
|
|
checkMessages() {
|
|
if (this.$auth.loggedIn) {
|
|
this.$axios.get('/api/admin/contactUsMessages')
|
|
.then(res => {
|
|
let unreadCount = res.data.filter(item => !item.read)
|
|
this.$store.commit('admin/set', ['unreadMessagesCount', unreadCount.length])
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|