Skip to content

Commit 7b132cf

Browse files
BasKierssebelga
authored andcommitted
fix: call execPostHooks on internalTransaction (#161)
1 parent 349ffe9 commit 7b132cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/model.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,14 @@ class Model extends Entity {
319319
if (internalTransaction) {
320320
// If we created the Transaction instance internally for the update, we commit it
321321
// otherwise we leave the commit() call to the transaction creator
322-
return transaction.commit().then(onTransactionSuccess);
322+
return transaction
323+
.commit()
324+
.then(() => transaction.execPostHooks().catch((err) => {
325+
entityUpdated[
326+
entityUpdated.gstore.ERR_HOOKS
327+
] = (entityUpdated[entityUpdated.gstore.ERR_HOOKS] || []).push(err);
328+
}))
329+
.then(onTransactionSuccess);
323330
}
324331

325332
return onTransactionSuccess();

0 commit comments

Comments
 (0)