forked from DebaucheryLibrarian/traxxx
Added tag filter to releases query, enabled on homepage.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import config from 'config';
|
||||
|
||||
async function get(endpoint, query = {}) {
|
||||
const queryString = Object.entries(query).reduce((acc, [key, value], index) => `${acc}${index > 0 ? '&' : ''}${key}=${value}`, '?');
|
||||
import queryString from 'query-string';
|
||||
|
||||
const res = await fetch(`${config.api.url}${endpoint}${queryString}`, {
|
||||
async function get(endpoint, query = {}) {
|
||||
const q = queryString.stringify(query);
|
||||
|
||||
const res = await fetch(`${config.api.url}${endpoint}?${q}`, {
|
||||
method: 'GET',
|
||||
mode: 'cors',
|
||||
credentials: 'same-origin',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import VTooltip from 'v-tooltip';
|
||||
|
||||
import router from './router';
|
||||
import initStore from './store';
|
||||
@@ -31,6 +32,8 @@ function init() {
|
||||
},
|
||||
});
|
||||
|
||||
Vue.use(VTooltip);
|
||||
|
||||
new Vue({ // eslint-disable-line no-new
|
||||
el: '#container',
|
||||
store,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { get } from '../api';
|
||||
|
||||
function initReleasesActions(_store, _router) {
|
||||
async function fetchReleases({ _commit }, releaseId) {
|
||||
const releases = await get(`/releases/${releaseId || ''}`);
|
||||
async function fetchReleases({ _commit }, { id, filter }) {
|
||||
const releases = await get(`/releases/${id || ''}`, { filter });
|
||||
|
||||
return releases;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user