Made hot fixes

This commit is contained in:
Sviatoslav Tsariov Yurievich 2025-05-24 00:12:57 +03:00
parent a80e0a0932
commit 770835efa8

View File

@ -17,7 +17,7 @@ def create_reservation():
current_user = ""#get_jwt_identity()
reservation = Reservation(**request.json, creator=current_user)
id = ReservationRepository.insert(reservation)
notify_clients(reservation.room_id)
notify_clients(reservation.room_id, reservation.date)
return jsonify({"message": "Reservation created successfully", "id": id})
@reservation_blueprint.route('/<reservation_id>', methods=['DELETE'])
@ -25,7 +25,7 @@ def create_reservation():
def cancel_reservation(reservation_id):
reservation = ReservationRepository.get_by_id(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:
return jsonify({"error": "Reservation not found"}), 404
return jsonify({"message": "Reservation cancelled"})