mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -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,
|
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',
|
||||||
|
|
Loading…
Reference in a new issue