Fix setting the subfleet pay

This commit is contained in:
Nabeel Shahzad
2018-04-23 10:36:11 -05:00
parent 6c83b539c8
commit 2c2b569c6c
2 changed files with 10 additions and 2 deletions

View File

@@ -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'));
}

View File

@@ -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,