Skip to content

Commit

Permalink
Uncomment reservations routes requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZaikoXander committed Oct 30, 2024
1 parent c707b11 commit 25f8187
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions app/controllers/reservations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
class ReservationsController < ApplicationController
# before_action :set_reservation, only: %i[ show update destroy ]
before_action :set_reservation, only: %i[ show update destroy ]

# GET /reservations
# def index
# @reservations = Reservation.all
def index
@reservations = Reservation.all

# render json: @reservations
# end
render json: @reservations
end

# GET /reservations/1
# def show
# render json: @reservation
# end
def show
render json: @reservation
end

# POST /reservations
def create
Expand All @@ -25,24 +25,24 @@ def create
end

# PATCH/PUT /reservations/1
# def update
# if @reservation.update(reservation_params)
# render json: @reservation
# else
# render json: @reservation.errors, status: :unprocessable_entity
# end
# end
def update
if @reservation.update(reservation_params)
render json: @reservation
else
render json: @reservation.errors, status: :unprocessable_entity
end
end

# DELETE /reservations/1
# def destroy
# @reservation.destroy!
# end
def destroy
@reservation.destroy!
end

private
# Use callbacks to share common setup or constraints between actions.
# def set_reservation
# @reservation = Reservation.find(params[:id])
# end
def set_reservation
@reservation = Reservation.find(params[:id])
end

# Only allow a list of trusted parameters through.
def reservation_params
Expand Down

0 comments on commit 25f8187

Please sign in to comment.