From 8d4a2effd155ffcf9dedf312eeb492edf706096a Mon Sep 17 00:00:00 2001 From: Afrijal Dzuhri Date: Fri, 6 Dec 2024 01:09:51 +0700 Subject: [PATCH] fix: product controller --- app/controllers/api/v1/products_controller.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/controllers/api/v1/products_controller.rb b/app/controllers/api/v1/products_controller.rb index 1bf6707..609e12b 100644 --- a/app/controllers/api/v1/products_controller.rb +++ b/app/controllers/api/v1/products_controller.rb @@ -1,18 +1,15 @@ class Api::V1::ProductsController < ApplicationController before_action :set_product, only: [:show, :update, :destroy] - # GET /products def index @products = Product.all.with_attached_image render json: @products.map { |product| product_json(product) } end - # GET /products/:id def show render json: product_json(@product) end - # POST /products def create @product = Product.new(flat_product_params) if @product.save @@ -22,7 +19,6 @@ def create end end - # PUT /products/:id def update if @product.update(flat_product_params) render json: product_json(@product) @@ -31,7 +27,6 @@ def update end end - # DELETE /products/:id def destroy @product.destroy head :no_content