Skip to content

Commit

Permalink
Add error response text and alert on submit/ save device following cr…
Browse files Browse the repository at this point in the history
…eation or edit
  • Loading branch information
coldfire84 committed Jan 24, 2020
1 parent 30ae1a6 commit ab4787a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/interfaces/views/pages/devices.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,11 @@ function saveDevice() {
//reload
document.location.reload();
}
}).fail(function(){
alert("failed to create device");
});
}).fail(
function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
}
);
} else {
alert("Name or description can not be empty and at least one action is needed");
}
Expand Down Expand Up @@ -798,7 +800,11 @@ function saveDevice() {
//reload
document.location.reload();
},
});
}).fail(
function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
}
);
// console.log(JSON.stringify(device));
} else {
alert("Name or description can not be empty and at least one action is needed");
Expand Down

0 comments on commit ab4787a

Please sign in to comment.