Skip to content

Commit

Permalink
add routes to products
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinix committed Feb 10, 2024
1 parent ff276be commit 5f74c42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/pento/catalog/product.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ defmodule Pento.Catalog.Product do
|> cast(attrs, [:name, :description, :unit_price, :sku])
|> validate_required([:name, :description, :unit_price, :sku])
|> unique_constraint(:sku)
|> validate_number(:unit_price, greater_than: 0.0)
end
end
1 change: 1 addition & 0 deletions lib/pento_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ defmodule PentoWeb.Router do

get "/", PageController, :home
live "/guess", WrongLive
resources "/products", ProductController
end

# Other scopes may use custom stacks.
Expand Down

0 comments on commit 5f74c42

Please sign in to comment.