Fix translator handler
Some checks failed
Build docker image / Build-Docker-Image (push) Has been cancelled

This commit is contained in:
2024-12-26 02:13:05 +01:00
parent d49d5339fe
commit 4f78a5cf82
2 changed files with 19 additions and 3 deletions

View File

@@ -125,7 +125,18 @@ async fn get_translated_books(
SELECT * FROM book_annotations WHERE book = b.id
) AS "annotation_exists!: bool"
FROM books b
JOIN book_authors ba ON b.id = ba.book
WHERE
b.is_deleted = false
AND ba.author = $1
AND b.lang = ANY($2)
OFFSET $3
LIMIT $4
"#,
translator_id,
&allowed_langs,
(pagination.page - 1) * pagination.size,
pagination.size
)
.fetch_all(&db.0)
.await