Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Errors updating articles #28

Open
fire opened this issue Oct 22, 2018 · 1 comment
Open

Errors updating articles #28

fire opened this issue Oct 22, 2018 · 1 comment

Comments

@fire
Copy link

fire commented Oct 22, 2018

Using the vue.js front end I had errors updating articles:

https://github.com/gothinkster/elixir-phoenix-realworld-example-app/blob/master/lib/real_world_web/controllers/article_controller.ex#L66

  def update(conn, %{"id" => slug, "article" => article_params}, user) do
    article =
      slug
      |> Blog.get_article_by_slug!()
      |> Repo.preload([:author, :favorites])
      |> Blog.load_favorite(user)

    with {:ok, %Article{} = article} <- Blog.update_article(article, article_params) do
      render(conn, "show.json", article: article)
    end
  end

Modified to use slug to get the article.

@lbighetti
Copy link
Collaborator

Hi @fire , can you post here what is elixir / otp version you are using and what is the error you're getting?

I can then try to reproduce locally and come back to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants