Fix setting the subfleet pay
This commit is contained in:
@@ -217,7 +217,6 @@ class RankController extends Controller
|
||||
$rank = $this->rankRepository->findWithoutFail($id);
|
||||
if (empty($rank)) {
|
||||
Flash::error('Rank not found!');
|
||||
|
||||
return redirect(route('admin.ranks.index'));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<script>
|
||||
function setEditable() {
|
||||
|
||||
const token = $('meta[name="csrf-token"]').attr('content');
|
||||
const api_key = $('meta[name="api-key"]').attr('content');
|
||||
|
||||
@if(isset($rank))
|
||||
$('#subfleets-table a').editable({
|
||||
type: 'text',
|
||||
@@ -9,7 +12,13 @@ function setEditable() {
|
||||
emptytext: 'inherited',
|
||||
url: '{{ url('/admin/ranks/'.$rank->id.'/subfleets') }}',
|
||||
title: 'Enter override value',
|
||||
ajaxOptions: {'type': 'put'},
|
||||
ajaxOptions: {
|
||||
type: 'put',
|
||||
headers: {
|
||||
'x-api-key': api_key,
|
||||
'X-CSRF-TOKEN': token,
|
||||
}
|
||||
},
|
||||
params: function (params) {
|
||||
return {
|
||||
subfleet_id: params.pk,
|
||||
|
||||
Reference in New Issue
Block a user