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})
{:ok, %Advert{}}
iex> update_advert(advert, %{image: bad_value})
iex> update_advert_image(advert, %{image: bad_value})
{:error, %Ecto.Changeset{}}
"""

View file

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

View file

@ -84,7 +84,7 @@ defmodule Philomena.Badges do
end
@doc """
Updates a badge.
Updates a badge without updating its image.
## Examples
@ -101,6 +101,18 @@ defmodule Philomena.Badges do
|> Repo.update()
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
badge
|> Badge.changeset(attrs)