diff --git a/lib/frenzy/item.ex b/lib/frenzy/item.ex index 7e7b28b..5cc236c 100644 --- a/lib/frenzy/item.ex +++ b/lib/frenzy/item.ex @@ -59,7 +59,7 @@ defmodule Frenzy.Item do url: String.t(), read: boolean(), read_date: DateTime.t(), - title: String.t(), + title: String.t() | nil, tombstone: boolean(), feed: Frenzy.Feed.t() | Ecto.Association.NotLoaded.t(), inserted_at: NaiveDateTime.t(), @@ -70,6 +70,6 @@ defmodule Frenzy.Item do def changeset(item, attrs) do item |> cast(attrs, [:guid, :title, :url, :creator, :date, :content, :read, :read_date, :tombstone]) - |> validate_required([:guid, :title, :url, :date, :content, :feed]) + |> validate_required([:guid, :url, :date, :content, :feed]) end end diff --git a/lib/frenzy_web/controllers/item_controller.ex b/lib/frenzy_web/controllers/item_controller.ex index 7b95479..2f065c5 100644 --- a/lib/frenzy_web/controllers/item_controller.ex +++ b/lib/frenzy_web/controllers/item_controller.ex @@ -44,7 +44,7 @@ defmodule FrenzyWeb.ItemController do read_date: Timex.now() }) - Repo.update(changeset) + {:ok, item} = Repo.update(changeset) redirect(conn, to: Routes.item_path(Endpoint, :show, item.id)) end