@@ -15,7 +15,6 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
15
15
alias GroupherServer.CMS . {
16
16
PostCommentReply ,
17
17
JobCommentReply ,
18
- VideoCommentReply ,
19
18
RepoCommentReply
20
19
}
21
20
@@ -213,17 +212,6 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
213
212
end
214
213
end
215
214
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
-
227
215
defp bridge_reply ( :repo , queryable , comment , attrs ) do
228
216
with { :ok , reply } <- ORM . create ( queryable , attrs ) do
229
217
ORM . update ( reply , % { reply_id: comment . id } )
@@ -256,27 +244,21 @@ defmodule GroupherServer.CMS.Delegate.CommentCURD do
256
244
# merge_comment_attrs when create comemnt
257
245
defp merge_comment_attrs ( :post , attrs , id ) , do: attrs |> Map . merge ( % { post_id: id } )
258
246
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 } )
260
247
defp merge_comment_attrs ( :repo , attrs , id ) , do: attrs |> Map . merge ( % { repo_id: id } )
261
248
262
249
defp merge_reply_attrs ( :post , attrs , comment ) ,
263
250
do: attrs |> Map . merge ( % { post_id: comment . post_id } )
264
251
265
252
defp merge_reply_attrs ( :job , attrs , comment ) , do: attrs |> Map . merge ( % { job_id: comment . job_id } )
266
253
267
- defp merge_reply_attrs ( :video , attrs , comment ) ,
268
- do: attrs |> Map . merge ( % { video_id: comment . video_id } )
269
-
270
254
defp merge_reply_attrs ( :repo , attrs , comment ) ,
271
255
do: attrs |> Map . merge ( % { repo_id: comment . repo_id } )
272
256
273
257
defp dynamic_comment_where ( :post , id ) , do: dynamic ( [ c ] , c . post_id == ^ id )
274
258
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 )
276
259
defp dynamic_comment_where ( :repo , id ) , do: dynamic ( [ c ] , c . repo_id == ^ id )
277
260
278
261
defp dynamic_reply_where ( :post , comment ) , do: dynamic ( [ c ] , c . post_id == ^ comment . post_id )
279
262
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 )
281
263
defp dynamic_reply_where ( :repo , comment ) , do: dynamic ( [ c ] , c . repo_id == ^ comment . repo_id )
282
264
end
0 commit comments