update error message fasilitas

This commit is contained in:
KhatamNugraha
2023-10-09 18:05:36 +07:00
parent 1a208e6524
commit 8cbb6bc799
2 changed files with 10 additions and 6 deletions

View File

@ -341,6 +341,7 @@
public function postFasilitas(Request $request){
if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any konfirmasibank.create !');
}
@ -384,10 +385,13 @@
echo json_encode(['status' => 'success', 'message' => 'Add fasilitas successfully.']);
} catch (Exception $e) {
return json_encode([
'status' => 'error',
'message' => $e->getMessage()
]);
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
// return json_encode([
// 'status' => 'error',
// 'message' => $e->getMessage()
// ]);
}
}

View File

@ -349,7 +349,7 @@
},
error: function(xhr, status, error) {
// Handle error response (if applicable)
var errors = data.responseJSON.errors;
var errors = xhr.responseJSON.errors;
$.each(errors, function(key, value) {
toastr.error(value);
});