Tied consent warning to session.

This commit is contained in:
DebaucheryLibrarian
2020-12-19 23:01:17 +01:00
parent be4d025505
commit bd77d4347d
10 changed files with 121 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import { graphql } from '../api';
import { graphql, post } from '../api';
import { curateRelease, curateActor } from '../curate';
function initUiActions(_store, _router) {
@@ -26,6 +26,12 @@ function initUiActions(_store, _router) {
localStorage.setItem('sfw', sfw);
}
async function setConsent({ _commit }, consent) {
const res = await post('/consent', consent);
return res.ok;
}
async function search({ _commit }, { query, limit = 20 }) {
const res = await graphql(`
query SearchReleases(
@@ -188,6 +194,7 @@ function initUiActions(_store, _router) {
setRange,
setBatch,
setSfw,
setConsent,
setTheme,
fetchStats,
};