Merge pull request #1238 from strongloop/fix/change-tracking-on-delete
Use `ctx.instance` provided by "after delete" hook
This commit is contained in:
commit
df770455eb
|
@ -1362,7 +1362,9 @@ function rectifyOnSave(ctx, next) {
|
|||
}
|
||||
|
||||
function rectifyOnDelete(ctx, next) {
|
||||
var id = getIdFromWhereByModelId(ctx.Model, ctx.where);
|
||||
var id = ctx.instance ? ctx.instance.getId() :
|
||||
getIdFromWhereByModelId(ctx.Model, ctx.where);
|
||||
|
||||
if (id) {
|
||||
ctx.Model.rectifyChange(id, reportErrorAndNext);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue