Added rudimentary tags page. Improved social match behavior.

This commit is contained in:
2019-12-01 05:32:47 +01:00
parent bead69de49
commit cf81aa99e0
41 changed files with 495 additions and 104 deletions

View File

@@ -1,10 +1,12 @@
import { get } from '../api';
function initActorActions(store, _router) {
async function fetchActors({ _commit }, actorId) {
const networks = await get(`/actors/${actorId || ''}`);
async function fetchActors({ _commit }, { actorId, limit = 100 }) {
if (actorId) {
return get(`/actors/${actorId}`, { limit });
}
return networks;
return get('/actors', { limit });
}
async function fetchActorReleases({ _commit }, actorId) {

View File

@@ -1,9 +1,7 @@
import config from 'config';
import queryString from 'query-string';
async function get(endpoint, query = {}) {
const q = queryString.stringify(query);
const q = new URLSearchParams(query).toString();
const res = await fetch(`${config.api.url}${endpoint}?${q}`, {
method: 'GET',

View File

@@ -8,7 +8,8 @@ import Network from '../components/networks/network.vue';
import Networks from '../components/networks/networks.vue';
import Actor from '../components/actors/actor.vue';
import Actors from '../components/actors/actors.vue';
import Tag from '../components/tag/tag.vue';
import Tag from '../components/tags/tag.vue';
import Tags from '../components/tags/tags.vue';
import NotFound from '../components/errors/404.vue';
Vue.use(VueRouter);
@@ -59,6 +60,11 @@ const routes = [
component: Networks,
name: 'networks',
},
{
path: '/tags',
component: Tags,
name: 'tags',
},
{
path: '*',
component: NotFound,

View File

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