mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Use serde-cs::CS with StarOr to reduce the logic duplication
This commit is contained in:
parent
10d3b367dc
commit
64b5b2e1f8
3 changed files with 20 additions and 14 deletions
|
@ -81,9 +81,9 @@ async fn get_tasks(
|
|||
|
||||
// We first transform a potential indexUid=* into a "not specified indexUid filter"
|
||||
// for every one of the filters: type, status, and indexUid.
|
||||
let type_ = type_.map(CS::into_inner).and_then(fold_star_or);
|
||||
let status = status.map(CS::into_inner).and_then(fold_star_or);
|
||||
let index_uid = index_uid.map(CS::into_inner).and_then(fold_star_or);
|
||||
let type_: Option<Vec<_>> = type_.map(CS::into_inner).and_then(fold_star_or);
|
||||
let status: Option<Vec<_>> = status.map(CS::into_inner).and_then(fold_star_or);
|
||||
let index_uid: Option<Vec<_>> = index_uid.map(CS::into_inner).and_then(fold_star_or);
|
||||
|
||||
// Then we filter on potential indexes and make sure that the search filter
|
||||
// restrictions are also applied.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue