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:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user