Syncing afterSave/afterDelete trigger calls (Issue #2489) (#2499)

* Implemented syncing afterSave/afterDelete trigger calls with REST request execution flow (Issue 2489). After this change, afterSave and afterDelete triggers CAN return a promise, which needs to be resolved inside a trigger for REST request flow to continue. If trigger doesn't return a promise, request flow continues.

* Added {} to multiline if.

* Fixed bad commit.

* Fixed problem with beforeSave triggers becoming async.
This commit is contained in:
Marko Matić
2016-08-17 15:26:42 +02:00
committed by Florent Vilmart
parent 430ae378f2
commit 3164b478ea
4 changed files with 182 additions and 14 deletions

View File

@@ -86,8 +86,7 @@ function del(config, auth, className, objectId, clientSDK) {
objectId: objectId
}, options);
}).then(() => {
triggers.maybeRunTrigger(triggers.Types.afterDelete, auth, inflatedObject, null, config);
return;
return triggers.maybeRunTrigger(triggers.Types.afterDelete, auth, inflatedObject, null, config);
});
}