Made hot fixes
This commit is contained in:
parent
a80e0a0932
commit
770835efa8
@ -17,7 +17,7 @@ def create_reservation():
|
|||||||
current_user = ""#get_jwt_identity()
|
current_user = ""#get_jwt_identity()
|
||||||
reservation = Reservation(**request.json, creator=current_user)
|
reservation = Reservation(**request.json, creator=current_user)
|
||||||
id = ReservationRepository.insert(reservation)
|
id = ReservationRepository.insert(reservation)
|
||||||
notify_clients(reservation.room_id)
|
notify_clients(reservation.room_id, reservation.date)
|
||||||
return jsonify({"message": "Reservation created successfully", "id": id})
|
return jsonify({"message": "Reservation created successfully", "id": id})
|
||||||
|
|
||||||
@reservation_blueprint.route('/<reservation_id>', methods=['DELETE'])
|
@reservation_blueprint.route('/<reservation_id>', methods=['DELETE'])
|
||||||
@ -25,7 +25,7 @@ def create_reservation():
|
|||||||
def cancel_reservation(reservation_id):
|
def cancel_reservation(reservation_id):
|
||||||
reservation = ReservationRepository.get_by_id(reservation_id)
|
reservation = ReservationRepository.get_by_id(reservation_id)
|
||||||
result = ReservationRepository.delete(reservation_id)
|
result = ReservationRepository.delete(reservation_id)
|
||||||
notify_clients(reservation["room_id"])
|
notify_clients(reservation["room_id"], reservation["date"])
|
||||||
if not result or result.deleted_count == 0:
|
if not result or result.deleted_count == 0:
|
||||||
return jsonify({"error": "Reservation not found"}), 404
|
return jsonify({"error": "Reservation not found"}), 404
|
||||||
return jsonify({"message": "Reservation cancelled"})
|
return jsonify({"message": "Reservation cancelled"})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user