forked from DebaucheryLibrarian/traxxx
Move tag posters and photos to media database.
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user