phpvms/resources/views/layouts/default/pireps/scripts.blade.php
Nabeel S 0d1f38cf85
Refactor all JS API calls #360 (#375)
* Refactor all JS API calls #360

* Remove unused imports

* Lint JS

* Fix doubled api key

* Formatting

* Added extra logging to distance lookup

* Remove the .editorconfig file in distrib

* shell check fixes

* Remove the .editorconfig file in distrib
2019-08-30 08:08:00 -04:00

17 lines
450 B
PHP

@section('scripts')
<script>
const select_id = "select#aircraft_select";
const destContainer = $('#fares_container');
$(select_id).change(e => {
const aircraft_id = $(select_id + ' option:selected').val();
const url = '/pireps/fares?aircraft_id=' + aircraft_id;
console.log('aircraft select change: ', aircraft_id);
phpvms.request(url).then(response => {
destContainer.html(response.data);
});
});
</script>
@endsection