def create_one(self, new_book_details: dict):
     """
     Adds new Book from dict with information passed from web form
     :param new_book_details:
     :return:
     """
     response = {"flash_message": "", "book_url_title": ""}
     book = Book(new_book_details)
     create_book = self.create(book)
     if create_book is not None:
         response['flash_message'] = "Could Not Add book, Try Again"
     else:
         response['flash_message'] = f'{book.get_formatted_title()} added!'
         response['book_url_title'] = book.get_title_for_url()
     return response
    def update_details(self, book_id: str, new_book_details: dict):
        """
        Push Update book Information to Mongo
        :param book_id:
        :param new_book_details:
        :return: response: dict {flash_message, book_title}
        """
        response = {"flash_message": "", "book_title": ""}

        book = Book(new_book_details)
        create_book = self.update(ObjectId(book_id), book.get_dict())
        if create_book is not None:
            response['flash_message'] = "Could Not Add book, Try Again"
        else:
            response[
                'flash_message'] = f'{book.get_formatted_title()} updated!'
            response['book_url_title'] = book.get_title_for_url()
        return response