Merge pull request #1224 from buster-so/big-nate-bus-1997-get-collectionid-on-fronted

collection prefetch
This commit is contained in:
Nate Kelley 2025-09-30 13:57:33 -06:00 committed by GitHub
commit 248994edff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,5 @@
import { createFileRoute } from '@tanstack/react-router';
import { prefetchGetCollection } from '@/api/buster_rest/collections';
import { CollectionIndividualController } from '@/controllers/CollectionIndividualController';
export const Route = createFileRoute('/app/_app/_asset/collections/$collectionId/')({
@ -6,12 +7,11 @@ export const Route = createFileRoute('/app/_app/_asset/collections/$collectionId
assetType: 'collection',
},
loader: async ({ params, context }) => {
const title = await context.getAssetTitle({
assetId: params.collectionId,
assetType: 'collection',
const collection = await prefetchGetCollection(context.queryClient, {
id: params.collectionId,
});
return {
title,
title: collection?.name,
};
},
head: ({ loaderData }) => ({