mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
fixed an issue with the PSR-7 context
- the search filters were not emptied between requests resulting in wrong search results when searching anime/manga
This commit is contained in:
parent
21958f15b6
commit
9bc2e14d44
@ -140,7 +140,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
/*
|
||||
* This bit is about a "mediator" pattern for handling requests.
|
||||
*/
|
||||
$this->app->singleton(Mediator::class, DefaultMediator::class);
|
||||
$this->app->bind(Mediator::class, DefaultMediator::class);
|
||||
/*
|
||||
* Contextual binding for the mediator.
|
||||
* Each request is represented as a data transfer object, and spatie/laravel-data package's service provider
|
||||
@ -378,7 +378,9 @@ class AppServiceProvider extends ServiceProvider
|
||||
return [
|
||||
// in RoadRunner we want to reset the repositories after each request, because we cache the query builders in them.
|
||||
// todo: refactor repositories to avoid caching query builders, so this step is not necessary
|
||||
JikanUnitOfWork::class
|
||||
JikanUnitOfWork::class,
|
||||
Mediator::class,
|
||||
SearchService::class
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ class RepositoryQuery extends RepositoryQueryBase implements RepositoryQueryCont
|
||||
|
||||
public function search(string $keywords, ?\Closure $callback = null): ScoutBuilder
|
||||
{
|
||||
return $this->searchable($keywords, $callback);
|
||||
return $this->searchable($keywords, $callback, true);
|
||||
}
|
||||
|
||||
public function where(string $key, mixed $value): Builder
|
||||
|
Loading…
x
Reference in New Issue
Block a user