mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
19 lines
512 B
JavaScript
19 lines
512 B
JavaScript
import gql from 'graphql-tag'
|
|
export const actions = {
|
|
async markAsRead({ commit, rootGetters }, notificationId) {
|
|
const client = this.app.apolloProvider.defaultClient
|
|
const mutation = gql(`
|
|
mutation($id: ID!, $read: Boolean!) {
|
|
UpdateNotification(id: $id, read: $read) {
|
|
id
|
|
read
|
|
}
|
|
}
|
|
`)
|
|
const variables = { id: notificationId, read: true }
|
|
const {
|
|
data: { UpdateNotification }
|
|
} = await client.mutate({ mutation, variables })
|
|
}
|
|
}
|