Fix warning

This commit is contained in:
Logan Hunt 2022-04-22 15:46:40 -06:00
parent deaaa30587
commit 2e38fdc8bb
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 52B3774857EB24B1

View File

@ -103,7 +103,7 @@ defmodule Aggiedit.Rooms do
def vote_post(%Post{} = post, %User{} = user, direction) do
is_up = direction == "upvote"
vote = %Vote{is_up: is_up, user: user, post: post}
%Vote{is_up: is_up, user: user, post: post}
|> Repo.insert(on_conflict: [set: [is_up: is_up]], conflict_target: [:user_id, :post_id])
post = change_post(post, %{score: vote_count(post)})