diff --git a/app/controllers/api/v1/cars_controller.rb b/app/controllers/api/v1/cars_controller.rb index fe4a461..4f2237e 100644 --- a/app/controllers/api/v1/cars_controller.rb +++ b/app/controllers/api/v1/cars_controller.rb @@ -1,6 +1,6 @@ class Api::V1::CarsController < ApplicationController before_action :set_car, only: %i[show update destroy] - skip_before_action :authenticate, only: [:destroy] + skip_before_action :authenticate, only: %i[index show create destroy] def index @cars = Car.all diff --git a/config/routes.rb b/config/routes.rb index 66af389..d7e108b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,8 +1,9 @@ Rails.application.routes.draw do namespace :api do namespace :v1 do - resources :users, only: [:create, :show] do - resources :cars, only: [:create, :show, :destroy] + resources :users, only: [:index, :create, :show, :destroy] do + resources :cars, only: [:index, :create, :show, :destroy] + resources :reservations, only: [:index, :create, :show, :destroy] end post 'login', to: 'authentication#login' end