Fix documentation errors

This commit is contained in:
Liam 2024-06-24 19:47:03 -04:00
parent bd4dfd9016
commit dbbc067679
3 changed files with 15 additions and 3 deletions

View file

@ -162,7 +162,7 @@ defmodule Philomena.Adverts do
iex> update_advert_image(advert, %{image: new_value}) iex> update_advert_image(advert, %{image: new_value})
{:ok, %Advert{}} {:ok, %Advert{}}
iex> update_advert(advert, %{image: bad_value}) iex> update_advert_image(advert, %{image: bad_value})
{:error, %Ecto.Changeset{}} {:error, %Ecto.Changeset{}}
""" """

View file

@ -20,7 +20,7 @@ defmodule Philomena.Autocomplete do
## Examples ## Examples
iex> get_artist_link() iex> get_autocomplete()
nil nil
iex> get_autocomplete() iex> get_autocomplete()

View file

@ -84,7 +84,7 @@ defmodule Philomena.Badges do
end end
@doc """ @doc """
Updates a badge. Updates a badge without updating its image.
## Examples ## Examples
@ -101,6 +101,18 @@ defmodule Philomena.Badges do
|> Repo.update() |> Repo.update()
end end
@doc """
Updates the image for a badge.
## Examples
iex> update_badge_image(badge, %{image: new_value})
{:ok, %Badge{}}
iex> update_badge_image(badge, %{image: bad_value})
{:error, %Ecto.Changeset{}}
"""
def update_badge_image(%Badge{} = badge, attrs) do def update_badge_image(%Badge{} = badge, attrs) do
badge badge
|> Badge.changeset(attrs) |> Badge.changeset(attrs)