Imagine.Accounts (imagine_cms v6.3.5)

The Accounts context.

Link to this section Summary

Functions

Returns an %Ecto.Changeset{} for tracking user changes.

Creates a user.

Deletes a User.

Gets a single user.

Returns the list of users.

Updates a user.

Link to this section Functions

Link to this function

change_user(user)

Returns an %Ecto.Changeset{} for tracking user changes.

Examples

iex> change_user(user)
%Ecto.Changeset{source: %User{}}
Link to this function

create_user(attrs)

Creates a user.

Examples

iex> create_user(%{field: value})
{:ok, %User{}}

iex> create_user(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

delete_user(user)

Deletes a User.

Examples

iex> delete_user(user)
{:ok, %User{}}

iex> delete_user(user)
{:error, %Ecto.Changeset{}}

Gets a single user.

Raises Ecto.NoResultsError if the User does not exist.

Examples

iex> get_user!(123)
%User{}

iex> get_user!(456)
** (Ecto.NoResultsError)
Link to this function

get_user_by_username_or_email(username_or_email)

Returns the list of users.

Examples

iex> list_users()
[%User{}, ...]
Link to this function

update_user(user, attrs)

Updates a user.

Examples

iex> update_user(user, %{field: new_value})
{:ok, %User{}}

iex> update_user(user, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_user_change_password(user, attrs)