From 8a1cdc3f7d058455c8362ee7fe2ba0fcea7b444e Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Mon, 9 Nov 2020 22:27:50 -0500 Subject: [PATCH] fix(hooks): incorrect hook executing for field-level afterChange --- src/collections/operations/create.js | 4 ++-- src/collections/operations/update.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/collections/operations/create.js b/src/collections/operations/create.js index f4cf028277..e2a0eed623 100644 --- a/src/collections/operations/create.js +++ b/src/collections/operations/create.js @@ -183,8 +183,8 @@ async function create(args) { result = await performFieldOperations(collectionConfig, { data: result, - hook: 'afterRead', - operation: 'read', + hook: 'afterChange', + operation: 'create', req, depth, overrideAccess, diff --git a/src/collections/operations/update.js b/src/collections/operations/update.js index 02331d4f87..8f1908e3df 100644 --- a/src/collections/operations/update.js +++ b/src/collections/operations/update.js @@ -223,8 +223,8 @@ async function update(args) { doc = await this.performFieldOperations(collectionConfig, { data: doc, - hook: 'afterRead', - operation: 'read', + hook: 'afterChange', + operation: 'update', req, id, depth,