Back.Posts (CAMI-Back v0.1.0)
View SourceThe Posts context.
Summary
Functions
Returns an %Ecto.Changeset{} for tracking post changes.
Creates a post.
Deletes a post.
Gets a single post.
Returns the list of post.
Updates a post.
Functions
Returns an %Ecto.Changeset{} for tracking post changes.
Examples
iex> change_post(post)
%Ecto.Changeset{data: %Post{}}
Creates a post.
Examples
iex> create_post(%{field: value})
{:ok, %Post{}}
iex> create_post(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Deletes a post.
Examples
iex> delete_post(post)
{:ok, %Post{}}
iex> delete_post(post)
{:error, %Ecto.Changeset{}}
Gets a single post.
Raises Ecto.NoResultsError if the Post does not exist.
Examples
iex> get_post!(123)
%Post{}
iex> get_post!(456)
** (Ecto.NoResultsError)
Returns the list of post.
Examples
iex> list_post()
[%Post{}, ...]
Updates a post.
Examples
iex> update_post(post, %{field: new_value})
{:ok, %Post{}}
iex> update_post(post, %{field: bad_value})
{:error, %Ecto.Changeset{}}