-
-
Save shankardevy/4d1cc70365b38566135daa0e6fc632fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Mango.Sales do | |
alias Mango.Repo | |
alias Mango.Sales.Order | |
def get_cart(id) do | |
Order | |
|> Repo.get_by(id: id, status: "In Cart") | |
end | |
def create_cart do | |
%Order{status: "In Cart"} |> Repo.insert!() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment