fix: 🐛 fix search ajax call

This commit is contained in:
Alexis Gousseau 2026-04-16 12:13:28 +02:00
parent 6a5a265ef0
commit c3199b4df4
3 changed files with 6 additions and 6 deletions

View file

@ -20,7 +20,7 @@ interface Stringable {
*/
slug: () => Stringable;
/**
* Pascal case a word based.
* Upper case the first letter of a word based.
* Examples:
* - some $ in the GARDEN ! -> Some $ in the GARDEN !
*
@ -28,7 +28,7 @@ interface Stringable {
*/
ucFirst: () => Stringable;
/**
* Pascal case a word based.
* Camel case a word based.
* Examples:
* - Some $ in the GARDEN ! -> some$InTheGarden!
*

View file

@ -20,6 +20,7 @@
'terms' => $searchTerm,
]);
$currentLocale = app()->getLocale();
$routeAjax = route('front.searching.ajax.news');
@endphp
@push('scripts')
@ -46,7 +47,7 @@
results.innerHTML = '';
pagination.innerHTML = '';
fetch('/search/load/results', {
fetch(@json($routeAjax), {
method: 'POST',
headers: {
'Content-Type': 'application/json',

View file

@ -26,12 +26,11 @@ Route::group(
->where('unsubscribe', 'unsubscribe|unsubscribe.php|unsubscribe.html|newsletter')
->name('unsubscribeNewsletter');
// Search routes.
Route::get(LaravelLocalization::transRoute('routes.front.search'), [SearchController::class, 'search'])
->name('search');
Route::post('/search/load/results', [SearchController::class, 'ajaxSearchLoadResults'])
->name('search.ajax.news');
Route::post('/searching/load/results', [SearchController::class, 'ajaxSearchLoadResults'])
->name('searching.ajax.news');
// Filters routes.
Route::prefix('posts')->group(function () {