loadRecord().then(processOnSaveCallbacks);
}
});
+ } else if ($scope.record_type == 'are') {
+ egCore.pcrud.remove($scope.Record()).then(function(resp) {
+ var evt = egCore.evt.parse(resp);
+ if (evt) {
+ return egAlertDialog.open(
+ egCore.strings.ALERT_DELETE_FAILED,
+ { id : $scope.recordId, desc : evt.desc }
+ );
+ } else {
+ loadRecord().then(processOnSaveCallbacks);
+ }
+ });
} else {
+ // fallback for sre?
$scope.Record().deleted(true);
return $scope.saveRecord();
}
loadRecord().then(processOnSaveCallbacks);
}
});
+ } else if ($scope.record_type = 'are') {
+ $scope.Record().deleted(false);
+ $scope.mangle_005(); // force an update of the 005 upon
+ // undelete to ensure that the MARC record
+ // is different, thereby forcing a
+ // a full reingest of the authority record
+ $scope.record.pruneEmptyFieldsAndSubfields();
+ $scope.Record().marc($scope.record.toXmlString());
+ egCore.pcrud.update($scope.Record()).then(function(resp) {
+ var evt = egCore.evt.parse(resp);
+ if (evt) {
+ return egAlertDialog.open(
+ egCore.strings.ALERT_UNDELETE_FAILED,
+ { id : $scope.recordId, desc : evt.desc }
+ );
+ } else {
+ ngToast.create(egCore.strings.SUCCESS_UNDELETE_RECORD);
+ loadRecord().then(processOnSaveCallbacks);
+ }
+ });
}
};