Handle needs_unread on tag query. Move News to top of tag list

This commit is contained in:
2024-07-22 07:24:28 -07:00
parent 79db94f67f
commit 834efc5c94
3 changed files with 10 additions and 3 deletions

View File

@@ -92,7 +92,9 @@ pub async fn search(
pub async fn tags(pool: &PgPool, needs_unread: bool) -> Result<Vec<Tag>, ServerError> {
// TODO: write separate query for needs_unread.
let tags = sqlx::query_file!("sql/tags.sql").fetch_all(pool).await?;
let tags = sqlx::query_file!("sql/tags.sql", needs_unread)
.fetch_all(pool)
.await?;
let tags = tags
.into_iter()
.map(|tag| {