This commit is contained in:
2023-08-11 23:41:11 +02:00
parent e257138f4e
commit 51b1523cfb
3 changed files with 10 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ async fn get_author_books(
let author = db let author = db
.author() .author()
.find_unique( .find_unique(
author::id::equals(author_id) author::id::equals(author_id),
) )
.with( .with(
author::author_annotation::fetch() author::author_annotation::fetch()
@@ -165,6 +165,7 @@ async fn get_author_books(
let books_count = db let books_count = db
.book() .book()
.count(vec![ .count(vec![
book::is_deleted::equals(false),
book::book_authors::some(vec![ book::book_authors::some(vec![
book_author::author_id::equals(author_id) book_author::author_id::equals(author_id)
]), ]),
@@ -177,6 +178,7 @@ async fn get_author_books(
let books = db let books = db
.book() .book()
.find_many(vec![ .find_many(vec![
book::is_deleted::equals(false),
book::book_authors::some(vec![ book::book_authors::some(vec![
book_author::author_id::equals(author_id) book_author::author_id::equals(author_id)
]), ]),
@@ -229,6 +231,7 @@ async fn get_author_books_available_types(
let books = db let books = db
.book() .book()
.find_many(vec![ .find_many(vec![
book::is_deleted::equals(false),
book::book_authors::some(vec![ book::book_authors::some(vec![
book_author::author_id::equals(author_id) book_author::author_id::equals(author_id)
]), ]),

View File

@@ -137,6 +137,7 @@ async fn get_sequence_available_types(
let books = db let books = db
.book() .book()
.find_many(vec![ .find_many(vec![
book::is_deleted::equals(false),
book::book_sequences::some(vec![ book::book_sequences::some(vec![
book_sequence::sequence_id::equals(sequence_id) book_sequence::sequence_id::equals(sequence_id)
]), ]),
@@ -184,6 +185,7 @@ async fn get_sequence_books(
let books_count = db let books_count = db
.book() .book()
.count(vec![ .count(vec![
book::is_deleted::equals(false),
book::book_sequences::some(vec![ book::book_sequences::some(vec![
book_sequence::sequence_id::equals(sequence_id) book_sequence::sequence_id::equals(sequence_id)
]), ]),
@@ -196,6 +198,7 @@ async fn get_sequence_books(
let books = db let books = db
.book() .book()
.find_many(vec![ .find_many(vec![
book::is_deleted::equals(false),
book::book_sequences::some(vec![ book::book_sequences::some(vec![
book_sequence::sequence_id::equals(sequence_id) book_sequence::sequence_id::equals(sequence_id)
]), ]),

View File

@@ -33,6 +33,7 @@ async fn get_translated_books(
let books_count = db let books_count = db
.book() .book()
.count(vec![ .count(vec![
book::is_deleted::equals(false),
book::translations::some(vec![ book::translations::some(vec![
translator::author_id::equals(translator_id) translator::author_id::equals(translator_id)
]), ]),
@@ -45,6 +46,7 @@ async fn get_translated_books(
let books = db let books = db
.book() .book()
.find_many(vec![ .find_many(vec![
book::is_deleted::equals(false),
book::translations::some(vec![ book::translations::some(vec![
translator::author_id::equals(translator_id) translator::author_id::equals(translator_id)
]), ]),
@@ -97,6 +99,7 @@ async fn get_translated_books_available_types(
let books = db let books = db
.book() .book()
.find_many(vec![ .find_many(vec![
book::is_deleted::equals(false),
book::translations::some(vec![ book::translations::some(vec![
translator::author_id::equals(translator_id) translator::author_id::equals(translator_id)
]), ]),