Refactoring client to reflect database changes.
This commit is contained in:
@@ -5,18 +5,7 @@ import {
|
||||
releaseTagsFragment,
|
||||
siteFragment,
|
||||
} from '../fragments';
|
||||
import { curateRelease } from '../curate';
|
||||
|
||||
function curateTag(tag) {
|
||||
const curatedTag = {
|
||||
...tag,
|
||||
};
|
||||
|
||||
if (tag.releases) curatedTag.releases = tag.releases.map(({ tagRelease }) => curateRelease(tagRelease));
|
||||
if (tag.poster) [curatedTag.poster] = tag.poster;
|
||||
|
||||
return curatedTag;
|
||||
}
|
||||
import { curateTag } from '../curate';
|
||||
|
||||
function initTagsActions(store, _router) {
|
||||
async function fetchTagBySlug(tagSlug) {
|
||||
@@ -31,20 +20,24 @@ function initTagsActions(store, _router) {
|
||||
name
|
||||
slug
|
||||
}
|
||||
poster: tagsMediasByTargetId(condition: { role: "poster" }) {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
poster: tagsPosterByTagId {
|
||||
media {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
}
|
||||
}
|
||||
photos: tagsMediasByTargetId(condition: { role: "photo" }) {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
photos: tagsPhotos {
|
||||
media {
|
||||
id
|
||||
thumbnail
|
||||
path
|
||||
comment
|
||||
}
|
||||
}
|
||||
releases: releasesTags {
|
||||
tagRelease {
|
||||
release {
|
||||
id
|
||||
title
|
||||
date
|
||||
@@ -82,8 +75,10 @@ function initTagsActions(store, _router) {
|
||||
id
|
||||
name
|
||||
slug
|
||||
poster: tagsMediasByTargetId(condition: { role: "poster" }) {
|
||||
thumbnail
|
||||
poster: tagsPosterByTagId {
|
||||
media {
|
||||
thumbnail
|
||||
}
|
||||
}
|
||||
group {
|
||||
name
|
||||
|
||||
Reference in New Issue
Block a user