From dbbc067679593f013aa63d8443a92a880862a3ea Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 24 Jun 2024 19:47:03 -0400 Subject: [PATCH] Fix documentation errors --- lib/philomena/adverts.ex | 2 +- lib/philomena/autocomplete.ex | 2 +- lib/philomena/badges.ex | 14 +++++++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/philomena/adverts.ex b/lib/philomena/adverts.ex index 06a1104e..f1794d8d 100644 --- a/lib/philomena/adverts.ex +++ b/lib/philomena/adverts.ex @@ -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{}} """ diff --git a/lib/philomena/autocomplete.ex b/lib/philomena/autocomplete.ex index f9cc9f44..e496ffc4 100644 --- a/lib/philomena/autocomplete.ex +++ b/lib/philomena/autocomplete.ex @@ -20,7 +20,7 @@ defmodule Philomena.Autocomplete do ## Examples - iex> get_artist_link() + iex> get_autocomplete() nil iex> get_autocomplete() diff --git a/lib/philomena/badges.ex b/lib/philomena/badges.ex index 494dd752..3cd0cd55 100644 --- a/lib/philomena/badges.ex +++ b/lib/philomena/badges.ex @@ -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)