Skip to content

Commit

Permalink
quick fix Swal on saving error Form
Browse files Browse the repository at this point in the history
  • Loading branch information
romfabbro committed Jan 12, 2017
1 parent fa19f54 commit b25afe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions Front/app/modules/stations/protocols/observation.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,18 @@ define([

handleErrors: function(response){
// individual equipment sensor is not available
var btnColor = 'rgb(221, 107, 85)';
if(response.responseJSON.sensor_available == false){
_this.sweetAlert('Data saving error', 'error', 'Selected sensor is not available');
this.swal({'title':'Data saving error', 'type':'error', 'text':'Selected sensor is not available', 'confirmButtonColor':'rgb(221, 107, 85)'});
}
else if(response.responseJSON.already_unequip == true ){
_this.sweetAlert('Data saving error', 'error', 'Selected sensor is already unequiped');
this.swal({'title':'Data saving error', 'type':'error', 'text':'Selected sensor is already unequiped', 'confirmButtonColor':'rgb(221, 107, 85)'});
}
else if(response.responseJSON.existing_equipment == false ){
_this.sweetAlert('Data saving error', 'error', 'Selected sensor is not equiped with this individual');
this.swal({'title':'Data saving error', 'type':'error', 'text':'Selected sensor is not equiped with this individual', 'confirmButtonColor':'rgb(221, 107, 85)'});
}
else if(response.responseJSON.errorSite == true ){
_this.sweetAlert('Data saving error', 'error', 'No monitored site is attached');
this.swal({'title':'Data saving error', 'type':'error', 'text':'No monitored site is attached', 'confirmButtonColor':'rgb(221, 107, 85)'});
}
},

Expand Down
2 changes: 1 addition & 1 deletion Front/app/ns_modules/ns_form/NsFormsModuleGit.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ define([
_this.afterSaveSuccess(response);
return true;
},
error: function (response) {
error: function (model, response) {
_this.savingError(response);
return false;
}
Expand Down

0 comments on commit b25afe3

Please sign in to comment.