DEV Community

loading...

Discussion on: Many to Many Relations in Ecto

Collapse
ceyhunkerti profile image
Ceyhun Kerti Author
  def dislike_comment(current_user, comment_id) do
    from(c in CommentLike, where: c.comment_id == ^comment_id and c.user_id == ^current_user.id)
    |> Repo.delete_all
  end
Collapse
juanpabloaj profile image
JuanPablo

thanks for the answer

I found a similar option here

elixirforum.com/t/how-to-remove-de...

thanks again :)