def delete_all_reservations_for_user(user_id): reservation_api = ReservationApi() response = reservation_api.delete_all_reservations_for_users(user_id) return app_response(response)
def delete_all_reservations_for_book(book_id): reservation_api = ReservationApi() response = reservation_api.delete_all_reservation_for_book(book_id) return app_response(response)
def update_reservation_for_user_and_book(user_id, book_id): reservation = request.get_json(force=True) reservation_api = ReservationApi() response = reservation_api.update_reservation( user_id=user_id, book_id=book_id, reservation_payload=reservation) return app_response(response)
def delete_reservation_for_user_and_book(user_id, book_id): reservation_api = ReservationApi() response = reservation_api.delete_reservation(user_id, book_id) return app_response(response)
def get_reservation_by_user_id_and_book_id(user_id, book_id): reservation_api = ReservationApi() response = reservation_api.get_reservation_by_user_id_and_book_id( user_id=user_id, book_id=book_id) return app_response(response)
def get_reservation_for_book(book_id): reservation_api = ReservationApi() response = reservation_api.get_reservation_by_book_id(book_id) return app_response(response)
def get_reservation_for_user(user_id): reservation_api = ReservationApi() response = reservation_api.get_reservation_by_user_id(user_id) return app_response(response)
def add_reservation(): reservation = request.get_json(force=True) reservation_api = ReservationApi() response = reservation_api.add_reservation(reservation) return app_response(response)
def get_reservations(): reservation_api = ReservationApi() response = reservation_api.get_reservations() return app_response(response)