forked from DebaucheryLibrarian/traxxx
Added notification clear, improved notification styling.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { graphql } from '../api';
|
||||
import { graphql, patch } from '../api';
|
||||
import { releaseFields, actorStashesFields } from '../fragments';
|
||||
import { curateRelease, curateActor, curateNotification } from '../curate';
|
||||
|
||||
@@ -39,10 +39,13 @@ function initUiActions(store, _router) {
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
) {
|
||||
notifications {
|
||||
notifications(
|
||||
first: 10
|
||||
) {
|
||||
id
|
||||
sceneId
|
||||
userId
|
||||
seen
|
||||
createdAt
|
||||
scene {
|
||||
${releaseFields}
|
||||
@@ -76,6 +79,18 @@ function initUiActions(store, _router) {
|
||||
return curatedNotifications;
|
||||
}
|
||||
|
||||
async function checkNotification(context, notificationId) {
|
||||
await patch(`/users/${store.state.auth.user?.id}/notifications/${notificationId}`, {
|
||||
seen: true,
|
||||
});
|
||||
}
|
||||
|
||||
async function checkNotifications() {
|
||||
await patch(`/users/${store.state.auth.user?.id}/notifications`, {
|
||||
seen: true,
|
||||
});
|
||||
}
|
||||
|
||||
async function search({ _commit }, { query, limit = 20 }) {
|
||||
const res = await graphql(`
|
||||
query SearchReleases(
|
||||
@@ -217,6 +232,8 @@ function initUiActions(store, _router) {
|
||||
}
|
||||
|
||||
return {
|
||||
checkNotification,
|
||||
checkNotifications,
|
||||
search,
|
||||
setTagFilter,
|
||||
setRange,
|
||||
|
||||
Reference in New Issue
Block a user