summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/api/products_controller.rb17
-rw-r--r--config/routes.rb1
2 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/api/products_controller.rb b/app/controllers/api/products_controller.rb
index cf542d4..0d78151 100644
--- a/app/controllers/api/products_controller.rb
+++ b/app/controllers/api/products_controller.rb
@@ -2,6 +2,21 @@
module Api
# ProductsController
- class ProductsController
+ class ProductsController < MasterController
+ def show; end
+
+ def index; end
+
+ def create; end
+
+ def update; end
+
+ def destroy; end
+
+ private
+
+ def permitted_params
+ params.permit(:name, :unitary_price, :bulk_price, :picture, :available_quantity, :categories)
+ end
end
end
diff --git a/config/routes.rb b/config/routes.rb
index 1abb376..06c5a88 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -11,6 +11,7 @@ Rails.application.routes.draw do
get '/account', to: 'user_accounts#show'
put '/account', to: 'user_accounts#update'
resources :companies, only: %i[index show create update]
+ resources :products, only: %i[index show create update destroy]
resources :user_accounts, only: %i[create]
resources :refresh_tokens, only: %i[create]
end