diff --git a/src/controllers/reservation_controller.py b/src/controllers/reservation_controller.py index 512acfd..e89d2a1 100644 --- a/src/controllers/reservation_controller.py +++ b/src/controllers/reservation_controller.py @@ -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('/', 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"})