@@ -26,7 +26,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
2626 % { community: community , body: body } = args ,
2727 % User { id: user_id }
2828 ) do
29- with { :ok , action } <- match_action ( thread , :comment ) ,
29+ with { :ok , action } <- match_action ( :post , :comment ) ,
3030 { :ok , content } <- ORM . find ( action . target , content_id ) ,
3131 { :ok , user } <- ORM . find ( User , user_id ) do
3232 Multi . new ( )
@@ -48,7 +48,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
4848 % { community: community , body: body } = args ,
4949 % User { id: user_id } = user
5050 ) do
51- with { :ok , action } <- match_action ( thread , :comment ) ,
51+ with { :ok , action } <- match_action ( :post , :comment ) ,
5252 { :ok , comment } <- ORM . find ( action . reactor , comment_id ) do
5353 next_floor = get_next_floor ( thread , action . reactor , comment )
5454
@@ -70,7 +70,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
7070 Creates a comment for psot, job ...
7171 """
7272 def update_comment ( thread , id , % { body: body } , % User { id: user_id } ) do
73- with { :ok , action } <- match_action ( thread , :comment ) ,
73+ with { :ok , action } <- match_action ( :post , :comment ) ,
7474 { :ok , content } <- ORM . find ( action . reactor , id ) ,
7575 true <- content . author_id == user_id do
7676 ORM . update ( content , % { body: body } )
@@ -81,7 +81,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
8181 Delete the comment and increase all the floor after this comment
8282 """
8383 def delete_comment ( thread , content_id ) do
84- with { :ok , action } <- match_action ( thread , :comment ) ,
84+ with { :ok , action } <- match_action ( :post , :comment ) ,
8585 { :ok , comment } <- ORM . find ( action . reactor , content_id ) do
8686 Multi . new ( )
8787 |> Multi . run ( :delete_comment , fn _ , _ ->
@@ -99,7 +99,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
9999 list paged comments
100100 """
101101 def paged_comments ( thread , content_id , % { page: page , size: size } = filters ) do
102- with { :ok , action } <- match_action ( thread , :comment ) do
102+ with { :ok , action } <- match_action ( :post , :comment ) do
103103 dynamic = dynamic_comment_where ( thread , content_id )
104104
105105 action . reactor
@@ -114,7 +114,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
114114 list paged comments participators
115115 """
116116 def paged_comments_participators ( thread , content_id , % { page: page , size: size } = filters ) do
117- with { :ok , action } <- match_action ( thread , :comment ) do
117+ with { :ok , action } <- match_action ( :post , :comment ) do
118118 dynamic = dynamic_comment_where ( thread , content_id )
119119
120120 action . reactor
@@ -133,7 +133,7 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
133133 end
134134
135135 def paged_replies ( thread , comment_id , % User { id: user_id } ) do
136- with { :ok , action } <- match_action ( thread , :comment ) do
136+ with { :ok , action } <- match_action ( :post , :comment ) do
137137 action . reactor
138138 |> where ( [ c ] , c . author_id == ^ user_id )
139139 |> join ( :inner , [ c ] , r in assoc ( c , :reply_to ) )
0 commit comments