Move tag posters and photos to media database.

This commit is contained in:
2019-12-04 21:58:08 +01:00
parent cf81aa99e0
commit 55e3130062
51 changed files with 861 additions and 184 deletions

View File

@@ -1,7 +1,8 @@
import config from 'config';
async function get(endpoint, query = {}) {
const q = new URLSearchParams(query).toString();
const curatedQuery = Object.entries(query).reduce((acc, [key, value]) => (value ? { ...acc, [key]: value } : acc), {}); // remove empty values
const q = new URLSearchParams(curatedQuery).toString();
const res = await fetch(`${config.api.url}${endpoint}?${q}`, {
method: 'GET',

View File

@@ -1,12 +1,23 @@
import { get } from '../api';
function initTagsActions(store, _router) {
async function fetchTags({ _commit }, { tagId, limit = 100, priority }) {
async function fetchTags({ _commit }, {
tagId,
limit = 100,
slug,
group,
priority,
}) {
if (tagId) {
return get(`/tags/${tagId}`);
}
return get('/tags', { limit, priority });
return get('/tags', {
limit,
slug,
priority,
group,
});
}
async function fetchTagReleases({ _commit }, tagId) {