View Source Mobilizon.Posts (Mobilizon v4.1.0-alpha.1)
The Posts context.
Summary
Functions
Creates a post.
Deletes a post
Get a post by it's ID
Get a post by it's URL
Returns the list of recent posts for a group
Returns the list of tags for the post.
Updates a post.
Functions
@spec create_post(map()) :: {:ok, Mobilizon.Posts.Post.t()} | {:error, Ecto.Changeset.t()}
Creates a post.
@spec delete_post(Mobilizon.Posts.Post.t()) :: {:ok, Mobilizon.Posts.Post.t()} | {:error, Ecto.Changeset.t()}
Deletes a post
@spec get_post(integer() | String.t()) :: Mobilizon.Posts.Post.t() | nil
Get a post by it's ID
@spec get_post_by_slug_with_preloads(String.t()) :: Mobilizon.Posts.Post.t() | nil
@spec get_post_by_url(String.t()) :: Mobilizon.Posts.Post.t() | nil
Get a post by it's URL
@spec get_post_by_url_with_preloads(String.t()) :: Mobilizon.Posts.Post.t() | nil
@spec get_post_with_preloads(integer() | String.t()) :: Mobilizon.Posts.Post.t() | nil
@spec get_posts_for_group( Mobilizon.Actors.Actor.t(), integer() | nil, integer() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Posts.Post.t())
Returns the list of recent posts for a group
@spec get_public_posts_for_group( Mobilizon.Actors.Actor.t(), integer() | nil, integer() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Posts.Post.t())
@spec list_posts_for_stream() :: Enum.t()
Link to this function
list_public_local_posts(page \\ nil, limit \\ nil, sort \\ nil, direction \\ nil)
View Source@spec list_public_local_posts( integer() | nil, integer() | nil, atom() | nil, atom() | nil ) :: Mobilizon.Storage.Page.t(Mobilizon.Posts.Post.t())
@spec list_tags_for_post(integer() | String.t()) :: [Mobilizon.Events.Tag.t()]
Returns the list of tags for the post.
@spec order_posts(Ecto.Queryable.t(), atom() | nil, atom() | nil) :: Ecto.Queryable.t()
@spec update_post(Mobilizon.Posts.Post.t(), map()) :: {:ok, Mobilizon.Posts.Post.t()} | {:error, Ecto.Changeset.t()}
Updates a post.