def update_book_data(self, book_id, json_data): if 'book_id' in json_data.keys() and json_data['book_id'] != book_id: raise IndexError("Id mismatched.") row_changed = Book.set_by_id(book_id, json_data) return self.get_book(book_id)
def mark_book_unavaliable(self, book_id): Book.set_by_id(book_id, {"is_available": False})