update error message fasilitas
This commit is contained in:
@ -341,6 +341,7 @@
|
|||||||
|
|
||||||
public function postFasilitas(Request $request){
|
public function postFasilitas(Request $request){
|
||||||
|
|
||||||
|
|
||||||
if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) {
|
if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) {
|
||||||
abort(403, 'Sorry !! You are Unauthorized to create any konfirmasibank.create !');
|
abort(403, 'Sorry !! You are Unauthorized to create any konfirmasibank.create !');
|
||||||
}
|
}
|
||||||
@ -384,11 +385,14 @@
|
|||||||
echo json_encode(['status' => 'success', 'message' => 'Add fasilitas successfully.']);
|
echo json_encode(['status' => 'success', 'message' => 'Add fasilitas successfully.']);
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return json_encode([
|
|
||||||
'status' => 'error',
|
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
|
||||||
'message' => $e->getMessage()
|
|
||||||
]);
|
// return json_encode([
|
||||||
}
|
// 'status' => 'error',
|
||||||
|
// 'message' => $e->getMessage()
|
||||||
|
// ]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -349,7 +349,7 @@
|
|||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
// Handle error response (if applicable)
|
// Handle error response (if applicable)
|
||||||
var errors = data.responseJSON.errors;
|
var errors = xhr.responseJSON.errors;
|
||||||
$.each(errors, function(key, value) {
|
$.each(errors, function(key, value) {
|
||||||
toastr.error(value);
|
toastr.error(value);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user