fix: handle pages without uid for metadata
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { GetLoyaltyPageMetaData } from "@/lib/graphql/Query/MetaDataLoyaltyPage.graphql"
|
||||
import { GetMyPagesMetaData } from "@/lib/graphql/Query/MetaDataMyPages.graphql"
|
||||
import { contentstackExtendedProcedureUID, router } from "@/server/trpc"
|
||||
import { contentstackBaseProcedure, router } from "@/server/trpc"
|
||||
|
||||
import {
|
||||
type GetLoyaltyPageMetaDataData,
|
||||
@@ -53,7 +53,11 @@ async function getMyPagesMetaData(variables: Variables) {
|
||||
}
|
||||
|
||||
export const metaDataQueryRouter = router({
|
||||
get: contentstackExtendedProcedureUID.query(async ({ ctx }) => {
|
||||
get: contentstackBaseProcedure.query(async ({ ctx }) => {
|
||||
if (!ctx.uid) {
|
||||
return []
|
||||
}
|
||||
|
||||
const variables = {
|
||||
locale: ctx.lang,
|
||||
url: ctx.pathname,
|
||||
|
||||
Reference in New Issue
Block a user