something awful login data

all the stuff to add 2 fields to the user object and to access the
logged0in user in a liveview session
This commit is contained in:
2022-07-18 15:16:57 +02:00
parent 3e8f4ef042
commit 7035fe5b2d
12 changed files with 129 additions and 62 deletions

View File

@ -95,6 +95,16 @@ defmodule SomethingErlang.Accounts do
## Settings
def change_user_sadata(%User{} = user, attrs \\ %{}) do
User.sadata_changeset(user, attrs)
end
def update_sadata(%User{} = user, attrs \\ %{}) do
user
|> change_user_sadata(attrs)
|> Repo.update()
end
@doc """
Returns an `%Ecto.Changeset{}` for changing the user email.