Call rebindCallback on errors as well (#9690)

This commit is contained in:
Niels Lyngsø
2021-01-20 14:26:40 +01:00
committed by GitHub
parent 6d712b0d16
commit da0c82aabd

View File

@@ -466,7 +466,7 @@
syncTreeNode($scope.content, data.path, false, args.reloadChildren);
eventsService.emit("content.saved", { content: $scope.content, action: args.action });
eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: true });
resetNestedFieldValiation(fieldsToRollback);
ensureDirtyIsSetIfAnyVariantIsDirty();
@@ -475,11 +475,14 @@
},
function (err) {
//needs to be manually set for infinite editing mode
$scope.page.isNew = false;
syncTreeNode($scope.content, $scope.content.path);
if (err.status === 400 && err.data) {
// content was saved but is invalid.
eventsService.emit("content.saved", { content: $scope.content, action: args.action, valid: false });
}
resetNestedFieldValiation(fieldsToRollback);
return $q.reject(err);