v0.09
This commit is contained in:
@@ -12,8 +12,8 @@ impl Mutation {
|
||||
pub async fn create_book(
|
||||
db: &DbConn,
|
||||
form_data: book::Model,
|
||||
) -> Result<book::ActiveModel, DbErr> {
|
||||
book::ActiveModel {
|
||||
) -> Result<InsertResult<book::ActiveModel>, DbErr> {
|
||||
let record = book::ActiveModel {
|
||||
open_library_key: Set(form_data.open_library_key.to_owned()),
|
||||
title: Set(form_data.title.to_owned()),
|
||||
edition_count: Set(form_data.edition_count.to_owned()),
|
||||
@@ -27,9 +27,8 @@ impl Mutation {
|
||||
rating: Set(form_data.rating.to_owned()),
|
||||
comments: Set(form_data.comments.to_owned()),
|
||||
..Default::default()
|
||||
}
|
||||
.save(db)
|
||||
.await
|
||||
};
|
||||
Book::insert(record).exec(db).await
|
||||
}
|
||||
|
||||
pub async fn create_book_author(
|
||||
|
||||
Reference in New Issue
Block a user