Merge pull request #80 from payloadcms/fix/update-hidden-fields

fix: removes overwrite from update operation
This commit is contained in:
James Mikrut
2021-02-23 10:46:04 -05:00
committed by GitHub

View File

@@ -107,7 +107,7 @@ async function update(incomingArgs: Arguments): Promise<Document> {
docWithLocales = JSON.parse(docWithLocales);
const originalDoc = await performFieldOperations(collectionConfig, {
depth,
depth: 0,
req,
data: docWithLocales,
hook: 'afterRead',
@@ -257,7 +257,7 @@ async function update(incomingArgs: Arguments): Promise<Document> {
result = await Model.findByIdAndUpdate(
{ _id: id },
result,
{ overwrite: true, new: true },
{ new: true },
);
result = result.toJSON({ virtuals: true });