fix(next): properly sets doc id types when using postgres (#9381)

Fixes #9351. When using Postgres, doc ids were being treated as a string
as opposed to a number within the admin panel. This led to issues for
anything relying on the `docID` from context, such as the join field not
properly populating initial data when creating new documents, etc.
This commit is contained in:
Jacob Fletcher
2024-11-20 15:02:08 -05:00
committed by GitHub
parent ef3748319e
commit 07a9125f9c
2 changed files with 4 additions and 4 deletions

View File

@@ -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
}
}

View File

@@ -74,9 +74,9 @@ export interface Config {
user: User & {
collection: 'users';
};
jobs?: {
jobs: {
tasks: unknown;
workflows?: unknown;
workflows: unknown;
};
}
export interface UserAuthOperations {