Fixes undefined error when validation fails on asset save

This commit is contained in:
snipe 2017-07-25 19:32:09 -07:00
parent dfa0714d44
commit 978a906513

View file

@ -384,10 +384,15 @@
data: formData, data: formData,
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
// AssetController flashes success to session, redirect to hardware page.
window.location.href = data.redirect_url;
// console.dir(data); // console.dir(data);
// console.log('submit was successful'); // AssetController flashes success to session, redirect to hardware page.
if (data.redirect_url) {
window.location.href = data.redirect_url;
return true;
}
window.location.reload(true);
return false;
}, },
error: function (data) { error: function (data) {
// AssetRequest Validator will flash all errors to session, this just refreshes to see them. // AssetRequest Validator will flash all errors to session, this just refreshes to see them.
@ -417,7 +422,7 @@
}); });
data._token = '{{ csrf_token() }}'; data._token = '{{ csrf_token() }}';
//console.log(data); console.log(data);
$.ajax({ $.ajax({
type: 'POST', type: 'POST',