@@ -15,7 +15,6 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
1515 alias GroupherServer.CMS . {
1616 PostCommentReply ,
1717 JobCommentReply ,
18- VideoCommentReply ,
1918 RepoCommentReply
2019 }
2120
@@ -213,17 +212,6 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
213212 end
214213 end
215214
216- defp bridge_reply ( :video , queryable , comment , attrs ) do
217- with { :ok , reply } <- ORM . create ( queryable , attrs ) do
218- ORM . update ( reply , % { reply_id: comment . id } )
219-
220- { :ok , _ } =
221- VideoCommentReply |> ORM . create ( % { video_comment_id: comment . id , reply_id: reply . id } )
222-
223- queryable |> ORM . find ( reply . id )
224- end
225- end
226-
227215 defp bridge_reply ( :repo , queryable , comment , attrs ) do
228216 with { :ok , reply } <- ORM . create ( queryable , attrs ) do
229217 ORM . update ( reply , % { reply_id: comment . id } )
@@ -256,27 +244,21 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
256244 # merge_comment_attrs when create comemnt
257245 defp merge_comment_attrs ( :post , attrs , id ) , do: attrs |> Map . merge ( % { post_id: id } )
258246 defp merge_comment_attrs ( :job , attrs , id ) , do: attrs |> Map . merge ( % { job_id: id } )
259- defp merge_comment_attrs ( :video , attrs , id ) , do: attrs |> Map . merge ( % { video_id: id } )
260247 defp merge_comment_attrs ( :repo , attrs , id ) , do: attrs |> Map . merge ( % { repo_id: id } )
261248
262249 defp merge_reply_attrs ( :post , attrs , comment ) ,
263250 do: attrs |> Map . merge ( % { post_id: comment . post_id } )
264251
265252 defp merge_reply_attrs ( :job , attrs , comment ) , do: attrs |> Map . merge ( % { job_id: comment . job_id } )
266253
267- defp merge_reply_attrs ( :video , attrs , comment ) ,
268- do: attrs |> Map . merge ( % { video_id: comment . video_id } )
269-
270254 defp merge_reply_attrs ( :repo , attrs , comment ) ,
271255 do: attrs |> Map . merge ( % { repo_id: comment . repo_id } )
272256
273257 defp dynamic_comment_where ( :post , id ) , do: dynamic ( [ c ] , c . post_id == ^ id )
274258 defp dynamic_comment_where ( :job , id ) , do: dynamic ( [ c ] , c . job_id == ^ id )
275- defp dynamic_comment_where ( :video , id ) , do: dynamic ( [ c ] , c . video_id == ^ id )
276259 defp dynamic_comment_where ( :repo , id ) , do: dynamic ( [ c ] , c . repo_id == ^ id )
277260
278261 defp dynamic_reply_where ( :post , comment ) , do: dynamic ( [ c ] , c . post_id == ^ comment . post_id )
279262 defp dynamic_reply_where ( :job , comment ) , do: dynamic ( [ c ] , c . job_id == ^ comment . job_id )
280- defp dynamic_reply_where ( :video , comment ) , do: dynamic ( [ c ] , c . video_id == ^ comment . video_id )
281263 defp dynamic_reply_where ( :repo , comment ) , do: dynamic ( [ c ] , c . repo_id == ^ comment . repo_id )
282264end
0 commit comments