This commit is contained in:
2024-12-26 01:28:32 +01:00
parent 3e8500e825
commit c58e10bfa0
29 changed files with 1622 additions and 865 deletions

View File

@@ -216,16 +216,16 @@ async fn get_author_books(
b.uploaded,
(
SELECT
JSONB_AGG(
JSONB_BUILD_OBJECT(
'id', authors.id,
'first_name', authors.first_name,
'last_name', authors.last_name,
'middle_name', authors.middle_name,
'annotation_exists', EXISTS(
ARRAY_AGG(
ROW(
authors.id,
authors.first_name,
authors.last_name,
authors.middle_name,
EXISTS(
SELECT * FROM author_annotations WHERE author = authors.id
)
)
)::author_type
)
FROM translations
JOIN authors ON authors.id = translations.author
@@ -233,11 +233,11 @@ async fn get_author_books(
) AS "translators!: Vec<Author>",
(
SELECT
JSONB_AGG(
JSONB_BUILD_OBJECT(
'id', sequences.id,
'name', sequences.name
)
ARRAY_AGG(
ROW(
sequences.id,
sequences.name
)::sequence_type
)
FROM book_sequences
JOIN sequences ON sequences.id = book_sequences.sequence