Skip to content

Commit

Permalink
fixup! controllers/krate/search: Expand the scope of forward seek-bas…
Browse files Browse the repository at this point in the history
…ed pagination
  • Loading branch information
eth3lbert committed Jan 24, 2024
1 parent 1bdd6e1 commit f312a08
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/krate/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ pub async fn search(app: AppState, req: Parts) -> AppResult<Json<Value>> {
query = query.order((crates::created_at.desc(), crates::id.asc()));
} else {
seek = seek.or(Some(Seek::Name));
query = query.then_order_by((crates::name.asc(), crates::id.asc()))
// Since the name is unique value, the inherent ordering becomes naturally unique.
// Therefore, an additional auxiliary ordering column is unnecessary in this case.
query = query.then_order_by(crates::name.asc())
}

let pagination: PaginationOptions = PaginationOptions::builder()
Expand Down

0 comments on commit f312a08

Please sign in to comment.