fix: community search sql offset

This commit is contained in:
trisua 2025-04-10 21:46:24 -04:00
parent 39cd25f0cc
commit 52ac144953
2 changed files with 8 additions and 11 deletions

View file

@ -161,7 +161,11 @@ impl DataManager {
let res = query_rows!(
&conn,
"SELECT * FROM communities WHERE title LIKE $1 ORDER BY member_count DESC, created DESC LIMIT $2 OFFSET $3",
params![&format!("%{query}%"), &(batch as i64), &(page as i64)],
params![
&format!("%{query}%"),
&(batch as i64),
&((page * batch) as i64)
],
|x| { Self::get_community_from_row(x) }
);