user-auth store frontend and backend v2

This commit is contained in:
2022-12-31 23:57:58 +05:30
parent aa1172bbc0
commit 495bc4f9b8
6 changed files with 51 additions and 75 deletions

View File

@@ -85,6 +85,7 @@ pub async fn find_books_plus_meta_in_page(
// Setup paginator
let books = Self::find_books_in_page(db,page.try_into().unwrap(),posts_per_page.try_into().unwrap(),userid, sort).await?;
let book_ids: Vec<i32> = books.0.clone().into_iter().map(|b| b.id).collect();
println!("SIZE IS {} and {:?}", book_ids.len(), book_ids);
let mut resbooks: Vec<BookAndMetaV2> = Vec::with_capacity(book_ids.len());
for book in books.0.iter() {
let bauthors: Vec<book_author::Model> = book.find_related(book_author::Entity).all(db).await?;