fix: removes select argument from create operation db calls (#13841)

Extension of https://github.com/payloadcms/payload/pull/13809

Fixes https://github.com/payloadcms/payload/issues/13769

Removes select arg from create operation and allows afterRead to filter
out select fields.

Leaving the select argument will create documents with only the selected
data.
This commit is contained in:
Jarrod Flesch
2025-09-17 10:40:31 -04:00
committed by GitHub
parent ae3b923139
commit a26d8d9554
2 changed files with 0 additions and 5 deletions

View File

@@ -12,7 +12,6 @@ type Args = {
password: string
payload: Payload
req: PayloadRequest
select?: SelectType
}
export const registerLocalStrategy = async ({
@@ -21,7 +20,6 @@ export const registerLocalStrategy = async ({
password,
payload,
req,
select,
}: Args): Promise<Record<string, unknown>> => {
const loginWithUsername = collection?.auth?.loginWithUsername
@@ -95,6 +93,5 @@ export const registerLocalStrategy = async ({
salt,
},
req,
select,
})
}

View File

@@ -267,14 +267,12 @@ export const createOperation = async <
password: data.password as string,
payload: req.payload,
req,
select,
})
} else {
doc = await payload.db.create({
collection: collectionConfig.slug,
data: resultWithLocales,
req,
select,
})
}