udia v0.1.1 Udia.Logs

The boundary for the Logs system.

Summary

Functions

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

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

Creates a category

Deletes a Category

Deletes a Post

Gets a single category

Gets a single post

Returns the list of categories

Return the list of posts

Updates a post

Functions

alphabetical(query)
change_category(category)

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

Examples

iex> change_category(category)
%Ecto.Changeset{source: %Category{}}
change_comment(comment)
change_post(post)

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

Examples

iex> change_post(post)
%Ecto.Changeset{source: %Post{}}
comment_changeset(comment, attrs)
create_category(attrs \\ %{})

Creates a category.

Examples

iex> create_category(category, %{field: value})
{:ok, %Category{}}

iex> create_category(category, %{field: bad_value})
{:error, %Ecto.Changeset{}}
create_comment(attrs \\ %{})
create_post(user, attrs \\ %{})

Creates a post.

Examples

iex> create_post(post, %{field: value})
{:ok, %Post{}}

iex> create_post(post, %{field: bad_value})
{:error, %Ecto.Changeset{}}
delete_category(category)

Deletes a Category.

Examples

iex> delete_category(category)
{:ok, %Category{}}

iex> delete_category(category)
{:error, %Ecto.Changeset{}}
delete_comment!(comment)
delete_post!(id)

Deletes a Post.

Examples

iex> delete_post(post)
{:ok, %Post{}}

iex> delete_post(post)
{:error, %Ecto.Changeset{}}
get_category!(id)

Gets a single category.

Raises Ecto.NoResultsError if the Category does not exist.

Examples

iex> get_category!(123)
%Category{}

iex> get_category!(456)
** (Ecto.NoResultsError)
get_comment!(id)
get_post!(id)

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)
list_categories()

Returns the list of categories.

Examples

iex> list_categories()
[%Category{}, ...]
list_posts()

Return the list of posts.

Examples

iex> list_posts()
[%Post{}, ...]
names_and_ids(query)
post_changeset(post, attrs)
update_category(category, attrs)

Updates a category.

Examples

iex> update_category(category, %{field: new_value})
{:ok, %Category{}}

iex> update_category(category, %{field: bad_value})
{:error, %Ecto.Changeset{}}
update_comment(comment, attrs)
update_post(post, attrs)

Updates a post.

Examples

iex> update_post(post, %{field: new_value})
{:ok, %Post{}}

iex> update_post(post, %{field: bad_value})
{:error, %Ecto.Changeset{}}