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