Skip to content

Commit 9d295fc

Browse files
committed
Fix ajax urls.
1 parent 0812597 commit 9d295fc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

resources/views/fields/select2_from_ajax.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
allowClear: true,
9898
@endif
9999
ajax: {
100-
url: "{{ $field['data_source'] ?? '/'.$crud->getRoute().'/ajax' }}",
100+
url: "/{{ ltrim($field['data_source'] ?? $crud->getRoute().'/ajax', '/') }}",
101101
dataType: 'json',
102102
quietMillis: 250,
103103
data: function (params) {

resources/views/fields/select2_from_ajax_multiple.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
placeholder: "{{ $field['placeholder'] }}",
7777
minimumInputLength: "{{ $field['minimum_input_length'] }}",
7878
ajax: {
79-
url: "{{ $field['data_source'] ?? '/'.$crud->getRoute().'/ajax' }}",
79+
url: "/{{ ltrim($field['data_source'] ?? $crud->getRoute().'/ajax', '/') }}",
8080
dataType: 'json',
8181
quietMillis: 250,
8282
data: function (params) {

resources/views/modal/create.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
3030
$.ajax({
3131
type: "POST",
32-
url: "/{{ $crud->route . '/ajax' }}",
32+
url: "/{{ ltrim($crud->route . '/ajax', '/') }}",
3333
data: $("#create_{{ $entity }}").serialize(), // serializes the form's elements.
3434
success: function (data) {
3535
new PNotify({

0 commit comments

Comments
 (0)