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
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
import { promise } from './promise.js';
|
|
/**
|
|
* This function is responsible for the following actions, in order:
|
|
* - Run condition
|
|
* - Execute field hooks
|
|
* - Validate data
|
|
* - Transform data for storage
|
|
* - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.
|
|
*/ export const traverseFields = async ({ id, blockData, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipValidation })=>{
|
|
const promises = [];
|
|
fields.forEach((field, fieldIndex)=>{
|
|
promises.push(promise({
|
|
id,
|
|
blockData,
|
|
collection,
|
|
context,
|
|
data,
|
|
doc,
|
|
docWithLocales,
|
|
errors,
|
|
field,
|
|
fieldIndex,
|
|
fieldLabelPath,
|
|
global,
|
|
mergeLocaleActions,
|
|
operation,
|
|
overrideAccess,
|
|
parentIndexPath,
|
|
parentIsLocalized: parentIsLocalized,
|
|
parentPath,
|
|
parentSchemaPath,
|
|
req,
|
|
siblingData,
|
|
siblingDoc,
|
|
siblingDocWithLocales,
|
|
siblingFields: fields,
|
|
skipValidation: skipValidation
|
|
}));
|
|
});
|
|
await Promise.all(promises);
|
|
};
|
|
|
|
//# sourceMappingURL=traverseFields.js.map |