collection prefetch

This commit is contained in:
Nate Kelley 2025-09-30 13:53:24 -06:00
parent e9d86488c6
commit 196d5af046
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
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 }) => ({