chore: fix linting errors and ts bugs.
This commit is contained in:
@@ -6,6 +6,7 @@ import { notFound } from 'next/navigation'
|
||||
|
||||
import NextApp from '@/spa/NextApp'
|
||||
import { normalizeFooterData, normalizeHeaderData } from '@/spa/cmsNavigation'
|
||||
import type { CmsRouteDoc } from '@/spa/cmsRoute'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
@@ -36,7 +37,7 @@ function routeTarget(pathname: string): { collection: RouteCollection; slug: str
|
||||
async function findRouteDoc(payload: Awaited<ReturnType<typeof getPayload>>, pathname: string, draft: boolean) {
|
||||
const target = routeTarget(pathname)
|
||||
const result = await payload.find({
|
||||
collection: target.collection as any,
|
||||
collection: target.collection,
|
||||
depth: 1,
|
||||
draft,
|
||||
overrideAccess: draft,
|
||||
@@ -56,7 +57,7 @@ async function findRouteDoc(payload: Awaited<ReturnType<typeof getPayload>>, pat
|
||||
|
||||
async function findList(payload: Awaited<ReturnType<typeof getPayload>>, collection: RouteCollection, draft: boolean) {
|
||||
const result = await payload.find({
|
||||
collection: collection as any,
|
||||
collection,
|
||||
depth: 1,
|
||||
draft,
|
||||
overrideAccess: draft,
|
||||
@@ -90,11 +91,11 @@ export default async function Page({ params }: Args) {
|
||||
footer={normalizeFooterData(footer)}
|
||||
cmsRoute={{
|
||||
collection: route.collection,
|
||||
doc: route.doc as any,
|
||||
doc: route.doc as unknown as CmsRouteDoc,
|
||||
lists: {
|
||||
preistraeger: preistraeger as any,
|
||||
events: events as any,
|
||||
posts: posts as any,
|
||||
preistraeger: preistraeger as unknown as CmsRouteDoc[],
|
||||
events: events as unknown as CmsRouteDoc[],
|
||||
posts: posts as unknown as CmsRouteDoc[],
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user