Skip to content

Commit 7fb4ae6

Browse files
committed
On a category page, show all crates in all subcategories too
1 parent d472f62 commit 7fb4ae6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/krate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ pub fn index(req: &mut Request) -> CargoResult<Response> {
530530
INNER JOIN categories \
531531
ON crates_categories.category_id = \
532532
categories.id \
533-
WHERE lower(categories.category) = lower($1)";
533+
WHERE categories.slug = $1 OR \
534+
categories.slug LIKE $1 || '::%'";
534535
(format!("SELECT crates.* {} ORDER BY {} LIMIT $2 OFFSET $3", base, sort_sql),
535536
format!("SELECT COUNT(crates.*) {}", base))
536537
})

0 commit comments

Comments
 (0)