Restored 'new' label client-side.

This commit is contained in:
DebaucheryLibrarian
2023-06-16 00:47:19 +02:00
parent 078837f276
commit c4424f30ec
7 changed files with 39 additions and 23 deletions

View File

@@ -1,6 +1,7 @@
import { graphql, get } from '../api';
import {
releaseFields,
batchFragment,
} from '../fragments';
import { curateTag, curateRelease } from '../curate';
import getDateRange from '../get-date-range';
@@ -14,7 +15,7 @@ function initTagsActions(store, _router) {
}) {
const { before, after, orderBy } = getDateRange(range);
const { tagBySlug } = await graphql(`
const { tagBySlug, batches: [lastBatch] } = await graphql(`
query Tag(
$tagSlug:String!
$offset: Int = 0,
@@ -180,6 +181,7 @@ function initTagsActions(store, _router) {
totalCount
}
}
${batchFragment}
}
`, {
tagSlug,
@@ -195,7 +197,7 @@ function initTagsActions(store, _router) {
return {
tag: curateTag(tagBySlug, null, curateRelease),
releases: tagBySlug.scenesConnection.releases.map((release) => curateRelease(release)),
releases: tagBySlug.scenesConnection.releases.map((release) => curateRelease(release, 'scene', { lastBatch: lastBatch.id })),
totalCount: tagBySlug.scenesConnection.totalCount,
};
}