diff --git a/packages/next/src/utilities/initPage/handleAdminPage.ts b/packages/next/src/utilities/initPage/handleAdminPage.ts index 77c1da15a28..9ad1a8eb7ce 100644 --- a/packages/next/src/utilities/initPage/handleAdminPage.ts +++ b/packages/next/src/utilities/initPage/handleAdminPage.ts @@ -51,9 +51,9 @@ export function getRouteInfo({ globalConfig = config.globals.find((global) => global.slug === globalSlug) } - // If the collection has an ID field, we need to determine the type of the ID field + // If the collection is using a custom ID, we need to determine it's type if (collectionConfig && payload) { - if (payload.collections?.[collectionSlug]) { + if (payload.collections?.[collectionSlug]?.customIDType) { idType = payload.collections?.[collectionSlug].customIDType } } diff --git a/test/joins/payload-types.ts b/test/joins/payload-types.ts index 0ce8f77f7ba..7218bad040a 100644 --- a/test/joins/payload-types.ts +++ b/test/joins/payload-types.ts @@ -74,9 +74,9 @@ export interface Config { user: User & { collection: 'users'; }; - jobs?: { + jobs: { tasks: unknown; - workflows?: unknown; + workflows: unknown; }; } export interface UserAuthOperations {