   end
 
   def delete(conn, %{"id" => id}) do
-    article = Repo.get!(Article, id)
+    article = conn.assigns[:article]
 
     # Here we use delete! (with a bang) because we expect
     # it to always work (and if it does not, it will raise).


    send_resp(conn, :no_content, "")
  end
end

    end
  end

  def show(conn, %{"id" => _}) do
    article = conn.assigns[:article]
    render(conn, "show.json", article: article)
  end

  def update(conn, %{"id" => id, "article" => article_params}) do
    article = conn.assigns[:article]
    changeset = Article.changeset(article, article_params)

    case Repo.update(changeset) do
