mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
Rename newDocument to data
This commit is contained in:
parent
5427e994b0
commit
69901e10eb
1 changed files with 2 additions and 1 deletions
|
@ -89,8 +89,9 @@ export const createMutator = async ({ collection, document, data, currentUser, v
|
|||
for(let fieldName of Object.keys(schema)) {
|
||||
let autoValue;
|
||||
if (schema[fieldName].onCreate) {
|
||||
// OpenCRUD backwards compatibility: keep both newDocument and data for now, but phase our newDocument eventually
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
autoValue = await schema[fieldName].onCreate({ newDocument: clone(newDocument), currentUser });
|
||||
autoValue = await schema[fieldName].onCreate({ newDocument: clone(newDocument), data: clone(newDocument), currentUser });
|
||||
} else if (schema[fieldName].onInsert) {
|
||||
// OpenCRUD backwards compatibility
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
|
|
Loading…
Add table
Reference in a new issue