Trying to cancel a save event on the client, based on a property failing a particular validation, but am getting a 500 error dialog in the backoffice.
Any ideas on how to handle this? Preference is to keep it client side as it's part of a suite of httpinterceptors managing other simple business logic.
function contentSave($q) {
var canceller = $q.defer();
return {
request: function (request) {
// check property, set cancel = true if invalide
if (cancel) {
request.timeout = canceller.promise;
canceller.resolve();
// save is cancelled, but ysod dialog is triggered, with no error message as the request was never sent.
}
return request || $q.when(request);
}
}
}
Cancel save on client side
Trying to cancel a save event on the client, based on a property failing a particular validation, but am getting a 500 error dialog in the backoffice.
Any ideas on how to handle this? Preference is to keep it client side as it's part of a suite of httpinterceptors managing other simple business logic.
is working on a reply...