Make beforeSave work when object is passed to success (#1937)

This commit is contained in:
Madhav Bhagat
2016-05-28 21:51:22 +05:30
committed by Florent Vilmart
parent 1c162101be
commit 181b12771d
2 changed files with 23 additions and 1 deletions

View File

@@ -131,7 +131,8 @@ export function getResponseObject(request, resolve, reject) {
return {
success: function(response) {
// Use the JSON response
if (response && request.triggerName === Types.beforeSave) {
if (response && !request.object.equals(response)
&& request.triggerName === Types.beforeSave) {
return resolve(response);
}
response = {};