From 9062360b56a77726407ff99beeae0b0a1f7e7640 Mon Sep 17 00:00:00 2001 From: Ethan Niser Date: Mon, 21 Oct 2024 07:52:46 -0700 Subject: [PATCH] fix collection slug query --- src/lib/queries.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/queries.ts b/src/lib/queries.ts index 96c2c4b..e90c6ca 100644 --- a/src/lib/queries.ts +++ b/src/lib/queries.ts @@ -112,13 +112,13 @@ export const getCategory = unstable_cache( ); export const getCollectionDetails = unstable_cache( - async (collectionName: string) => + async (collectionSlug: string) => db.query.collections.findMany({ with: { categories: true, }, - where: (collections, { eq }) => eq(collections.name, collectionName), - orderBy: (collections, { asc }) => asc(collections.name), + where: (collections, { eq }) => eq(collections.slug, collectionSlug), + orderBy: (collections, { asc }) => asc(collections.slug), }), ["collection"], {