Added tag filter to releases query, enabled on homepage.

This commit is contained in:
2019-11-13 03:14:24 +01:00
parent d1212725bb
commit f9f9cc7977
26 changed files with 555 additions and 192 deletions

View File

@@ -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',

View File

@@ -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,

View File

@@ -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;
}