Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit3243c53

Browse files
committed
fix(comment-upvote): edge case of isAuthorUpvoted
1 parent8123f57 commit3243c53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎lib/groupher_server/cms/delegates/comment_action.ex‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,11 @@ defmodule GroupherServer.CMS.Delegate.CommentAction do
211211

212212
ORM.update(comment,%{upvotes_count:Enum.max([upvotes_count,0])})
213213
end)
214-
|>Multi.run(:check_article_author_upvoted,fn_,%{desc_upvotes_count:updated_comment}->
215-
update_article_author_upvoted_info(updated_comment,user_id)
214+
|>Multi.run(:unset_article_author_upvoted,fn_,%{desc_upvotes_count:updated_comment}->
215+
meta=updated_comment.meta|>Map.put(:is_article_author_upvoted,false)
216+
updated_comment|>ORM.update_meta(meta)
216217
end)
217-
|>Multi.run(:viewer_states,fn_,%{check_article_author_upvoted:comment}->
218+
|>Multi.run(:viewer_states,fn_,%{unset_article_author_upvoted:comment}->
218219
viewer_has_upvoted=Enum.member?(comment.meta.upvoted_user_ids,user_id)
219220
viewer_has_reported=Enum.member?(comment.meta.reported_user_ids,user_id)
220221

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp