include csrf token and fix escaping for admin scripts

This commit is contained in:
Nabeel Shahzad
2018-03-13 01:48:47 -05:00
parent bff80c2dc7
commit 684ee545cf
9 changed files with 110 additions and 20 deletions

View File

@@ -8,9 +8,16 @@ function setEditable() {
emptytext: 'inherited',
url: '{{ url('/admin/flights/'.$flight->id.'/fares') }}',
title: 'Enter override value',
ajaxOptions: {'type': 'put'},
ajaxOptions: {
type: 'post',
headers: {
'x-api-key': '{{ Auth::user()->api_key }}',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
params: function (params) {
return {
_method: 'put',
fare_id: params.pk,
name: params.name,
value: params.value
@@ -28,9 +35,16 @@ $(document).ready(function () {
mode: 'inline',
emptytext: '0',
url: '/admin/flights/{{ $flight->id }}/fields',
ajaxOptions: {'type': 'put'},
ajaxOptions: {
type: 'post',
headers: {
'x-api-key': '{{ Auth::user()->api_key }}',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
},
params: function (params) {
return {
_method: 'put',
field_id: params.pk,
name: params.name,
value: params.value