This needs to be register_users
(plural)?
iex(3)> params = %{email: "mercutio@grox.io", password: "R0sesBy0therNames"}
%{password: "R0sesBy0therNames", email: "mercutio@grox.io"}
iex(4)> Accounts.register_user(params)
** (UndefinedFunctionError) function Pento.Accounts.register_user/1 is undefined or private. Did you mean:
* register_users/1
(pento 0.1.0) Pento.Accounts.register_user(%{password: "R0sesBy0therNames", email: "mercutio@grox.io"})
iex:4: (file)
iex(4)> Accounts.register_users(params)
[debug] QUERY OK source="users" db=18.2ms decode=1.2ms queue=11.6ms idle=1575.3ms
SELECT TRUE FROM "users" AS u0 WHERE (u0."email" = $1) LIMIT 1 ["mercutio@grox.io"]
↳ Ecto.Changeset.unsafe_validate_unique/4, at: lib/ecto/changeset.ex:2719
[debug] QUERY OK source="users" db=4.9ms queue=1.4ms idle=565.7ms
INSERT INTO "users" ("email","hashed_password","inserted_at","updated_at") VALUES ($1,$2,$3,$4) RETURNING "id" ["mercutio@grox.io", "$2b$12$bF83rkiRoMW/m3N57US5N.yF5D8W4NzB1TxWiaJBOiMcFsmsE.pAK", ~U[2024-09-01 16:44:55Z], ~U[2024-09-01 16:44:55Z]]
↳ :elixir.eval_external_handler/3, at: src/elixir.erl:386
{:ok,
#Pento.Accounts.Users<
__meta__: #Ecto.Schema.Metadata<:loaded, "users">,
id: 1,
email: "mercutio@grox.io",
confirmed_at: nil,
inserted_at: ~U[2024-09-01 16:44:55Z],
updated_at: ~U[2024-09-01 16:44:55Z],
...
>}
iex(5)>