@@ -63,7 +63,7 @@ defmodule GroupherServer.CMS.Delegate.ArticleCommentAction do
6363 )
6464 end )
6565 |> Repo . transaction ( )
66- |> upsert_comment_result ( )
66+ |> result ( )
6767 end
6868 end
6969
@@ -77,7 +77,7 @@ defmodule GroupherServer.CMS.Delegate.ArticleCommentAction do
7777 ORM . findby_delete ( ArticlePinedComment , % { article_comment_id: comment . id } )
7878 end )
7979 |> Repo . transaction ( )
80- |> upsert_comment_result ( )
80+ |> result ( )
8181 end
8282 end
8383
@@ -141,7 +141,7 @@ defmodule GroupherServer.CMS.Delegate.ArticleCommentAction do
141141 |> Repo . update ( )
142142 end )
143143 |> Repo . transaction ( )
144- |> upsert_comment_result ( )
144+ |> result ( )
145145 end
146146 end
147147
@@ -166,7 +166,7 @@ defmodule GroupherServer.CMS.Delegate.ArticleCommentAction do
166166 update_article_author_upvoted_info ( comment , user_id )
167167 end )
168168 |> Repo . transaction ( )
169- |> upsert_comment_result ( )
169+ |> result ( )
170170 end
171171 end
172172
@@ -194,7 +194,7 @@ defmodule GroupherServer.CMS.Delegate.ArticleCommentAction do
194194 update_article_author_upvoted_info ( updated_comment , user_id )
195195 end )
196196 |> Repo . transaction ( )
197- |> upsert_comment_result ( )
197+ |> result ( )
198198 end
199199 end
200200
@@ -324,24 +324,24 @@ defmodule GroupherServer.CMS.Delegate.ArticleCommentAction do
324324 ORM . update_meta ( comment , meta )
325325 end
326326
327- defp upsert_comment_result ( { :ok , % { create_article_comment: result } } ) , do: { :ok , result }
328- defp upsert_comment_result ( { :ok , % { add_reply_to: result } } ) , do: { :ok , result }
329- defp upsert_comment_result ( { :ok , % { check_article_author_upvoted: result } } ) , do: { :ok , result }
330- defp upsert_comment_result ( { :ok , % { fold_comment_report_too_many: result } } ) , do: { :ok , result }
331- defp upsert_comment_result ( { :ok , % { update_comment_flag: result } } ) , do: { :ok , result }
332- defp upsert_comment_result ( { :ok , % { delete_article_comment: result } } ) , do: { :ok , result }
327+ defp result ( { :ok , % { create_article_comment: result } } ) , do: { :ok , result }
328+ defp result ( { :ok , % { add_reply_to: result } } ) , do: { :ok , result }
329+ defp result ( { :ok , % { check_article_author_upvoted: result } } ) , do: { :ok , result }
330+ defp result ( { :ok , % { fold_comment_report_too_many: result } } ) , do: { :ok , result }
331+ defp result ( { :ok , % { update_comment_flag: result } } ) , do: { :ok , result }
332+ defp result ( { :ok , % { delete_article_comment: result } } ) , do: { :ok , result }
333333
334- defp upsert_comment_result ( { :error , :create_article_comment , result , _steps } ) do
334+ defp result ( { :error , :create_article_comment , result , _steps } ) do
335335 raise_error ( :create_comment , result )
336336 end
337337
338- defp upsert_comment_result ( { :error , :add_participator , result , _steps } ) do
338+ defp result ( { :error , :add_participator , result , _steps } ) do
339339 { :error , result }
340340 end
341341
342- defp upsert_comment_result ( { :error , :create_abuse_report , result , _steps } ) do
342+ defp result ( { :error , :create_abuse_report , result , _steps } ) do
343343 { :error , result }
344344 end
345345
346- defp upsert_comment_result ( { :error , _ , result , _steps } ) , do: { :error , result }
346+ defp result ( { :error , _ , result , _steps } ) , do: { :error , result }
347347end
0 commit comments