Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
25 lines
729 B
Plaintext
25 lines
729 B
Plaintext
import { traverseFields } from './traverseFields.js';
|
|
/**
|
|
* This function is responsible for running beforeDuplicate hooks
|
|
* against a document including all locale data.
|
|
* It will run each field's beforeDuplicate hook
|
|
* and return the resulting docWithLocales.
|
|
*/ export const beforeDuplicate = async ({ id, collection, context, doc, overrideAccess, req })=>{
|
|
await traverseFields({
|
|
id,
|
|
collection,
|
|
context,
|
|
doc,
|
|
fields: collection.fields,
|
|
overrideAccess,
|
|
parentIndexPath: '',
|
|
parentIsLocalized: false,
|
|
parentPath: '',
|
|
parentSchemaPath: '',
|
|
req,
|
|
siblingDoc: doc
|
|
});
|
|
return doc;
|
|
};
|
|
|
|
//# sourceMappingURL=index.js.map |