Skip to content

Commit f312a08

Browse files
committed
fixup! controllers/krate/search: Expand the scope of forward seek-based pagination
1 parent 1bdd6e1 commit f312a08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/controllers/krate/search.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ pub async fn search(app: AppState, req: Parts) -> AppResult<Json<Value>> {
137137
query = query.order((crates::created_at.desc(), crates::id.asc()));
138138
} else {
139139
seek = seek.or(Some(Seek::Name));
140-
query = query.then_order_by((crates::name.asc(), crates::id.asc()))
140+
// Since the name is unique value, the inherent ordering becomes naturally unique.
141+
// Therefore, an additional auxiliary ordering column is unnecessary in this case.
142+
query = query.then_order_by(crates::name.asc())
141143
}
142144

143145
let pagination: PaginationOptions = PaginationOptions::builder()

0 commit comments

Comments
 (0)