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,6 @@
import { graphql } from '../api';
// import { sitesFragment, releaseFields } from '../fragments';
import { releaseFields, campaignsFragment } from '../fragments';
import { releaseFields, batchFragment, campaignsFragment } from '../fragments';
import { curateEntity } from '../curate';
import getDateRange from '../get-date-range';
@@ -14,7 +14,7 @@ function initEntitiesActions(store, router) {
}) {
const { before, after, orderBy } = getDateRange(range);
const { entity } = await graphql(`
const { entity, batches: [lastBatch] } = await graphql(`
query Entity(
$entitySlug: String!
$entityType: String! = "channel"
@@ -110,6 +110,7 @@ function initEntitiesActions(store, router) {
totalCount
}
}
${batchFragment}
}
`, {
entitySlug,
@@ -130,7 +131,7 @@ function initEntitiesActions(store, router) {
}
return {
entity: curateEntity(entity, null, entity.connection.releases),
entity: curateEntity(entity, null, entity.connection.releases, { lastBatch: lastBatch.id }),
totalCount: entity.connection.totalCount,
};
}