mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Fixes undefined error when validation fails on asset save
This commit is contained in:
parent
dfa0714d44
commit
978a906513
|
@ -384,10 +384,15 @@
|
|||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// AssetController flashes success to session, redirect to hardware page.
|
||||
window.location.href = data.redirect_url;
|
||||
// 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) {
|
||||
// AssetRequest Validator will flash all errors to session, this just refreshes to see them.
|
||||
|
@ -417,7 +422,7 @@
|
|||
});
|
||||
|
||||
data._token = '{{ csrf_token() }}';
|
||||
//console.log(data);
|
||||
console.log(data);
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
|
Loading…
Reference in a new issue