Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 6567e40

Browse files
committed
refactor(email): use with drop hooks thought
1 parent c8e540b commit 6567e40

File tree

1 file changed

+5
-8
lines changed
  • lib/groupher_server/billing/delegates

1 file changed

+5
-8
lines changed

lib/groupher_server/billing/delegates/curd.ex

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,10 @@ defmodule GroupherServer.Billing.Delegate.CURD do
8888
|> Map.merge(~m(user_id hash_id state)a)
8989
|> map_atom_value(:string)
9090

91-
# {:ok, record} = BillRecord |> ORM.create(attrs)
92-
# TODO:
93-
{:ok, record} = BillRecord |> ORM.create(attrs)
94-
# IO.inspect(record, label: "record ->")
95-
Email.notify_admin(record, :payment)
96-
# {:ok, record} = BillRecord |> ORM.create(attrs, {after_success: })
97-
# i email to admin
98-
{:ok, record}
91+
with {:ok, record} <- ORM.create(BillRecord, attrs) do
92+
Email.notify_admin(record, :payment)
93+
94+
{:ok, record}
95+
end
9996
end
10097
end

0 commit comments

Comments
 (0)