Skip to content

Commit

Permalink
Fix the linter offenses.
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-noori committed Oct 12, 2023
1 parent b7fd60d commit bd519b8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/controllers/api/reservations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ def update

# DELETE /reservations/1
def destroy
begin
@reservation.destroy
render json: { message: 'Reservation deleted successfully' }
rescue ActiveRecord::RecordNotFound
render json: { error: 'Reservation not found' }, status: :not_found
rescue StandardError => e
render json: { error: e.message }, status: :unprocessable_entity
end
@reservation.destroy
render json: { message: 'Reservation deleted successfully' }
rescue ActiveRecord::RecordNotFound
render json: { error: 'Reservation not found' }, status: :not_found
rescue StandardError => e
render json: { error: e.message }, status: :unprocessable_entity
end

private
Expand Down

0 comments on commit bd519b8

Please sign in to comment.