From cdaa8cc29f58308a387375ec41eafd0d38b13bcb Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Mon, 14 Nov 2022 08:18:58 -0500 Subject: [PATCH] fix: global afterRead and afterChange execution (#1405) --- src/globals/operations/update.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/globals/operations/update.ts b/src/globals/operations/update.ts index 04223d0fbe..4f49ff63ce 100644 --- a/src/globals/operations/update.ts +++ b/src/globals/operations/update.ts @@ -234,12 +234,11 @@ async function update(args: Args): Promise { // afterRead - Global // ///////////////////////////////////// - await globalConfig.hooks.afterChange.reduce(async (priorHook, hook) => { + await globalConfig.hooks.afterRead.reduce(async (priorHook, hook) => { await priorHook; global = await hook({ doc: global, - previousDoc: originalDoc, req, }) || global; }, Promise.resolve());