Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroweb committed Nov 18, 2024
1 parent dfd5abb commit 58e2d3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions volumes/backend/app/controllers/api/v1/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ module V1
class ProductsController < Api::ApplicationController
def index
products = ProductFinder.new(params: find_product_params).execute
render json: Api::ProductsSerializer.new(products).render_json, status: :ok
render json: Api::Products::ProductListSerializer.new(products), status: :ok
end

def show
render json: Api::ProductSerializer.new(product).render_json, status: :ok
render json: Api::Products::ProductDetailSerializer.new(product), status: :ok
end

def create
product = ::Products::Create.call(params: create_product_params)
render json: Api::ProductSerializer.new(product).render_json, status: :ok
render json: Api::Products::ProductDetailSerializer.new(product), status: :ok
end

def update
::Products::Update.call(product:, params: update_product_params)
inspect
render json: Api::ProductSerializer.new(product).render_json, status: :ok
render json: Api::Products::ProductDetailSerializer.new(product), status: :ok
end

def destroy
Expand Down

0 comments on commit 58e2d3d

Please sign in to comment.