@@ -88,7 +88,7 @@ defmodule CF.Moderation do
8888 UserAction
8989 |> without_user_feedback ( user )
9090 |> where ( [ a , _ ] , a . id == ^ action_id )
91- |> join ( :inner , [ a , _ ] , f in Flag , f . action_id == a . id )
91+ |> join ( :inner , [ a , _ ] , f in Flag , on: f . action_id == a . id )
9292 |> group_by ( [ a , _ , _ ] , a . id )
9393 # Following conditions will fail if target action is not reported. This is on purpose
9494 |> being_reported ( )
@@ -110,6 +110,7 @@ defmodule CF.Moderation do
110110 Comment
111111 |> where ( [ c ] , c . id == ^ comment_id )
112112 |> where ( [ c ] , c . is_reported == false )
113+ |> select ( [ c ] , c )
113114 |> Repo . update_all ( [ set: [ is_reported: true ] ] , returning: true )
114115 |> case do
115116 { 1 , [ comment ] } ->
@@ -124,7 +125,7 @@ defmodule CF.Moderation do
124125
125126 defp without_user_feedback ( query , user ) do
126127 query
127- |> join ( :left , [ a ] , fb in subquery ( user_feedbacks ( user ) ) , fb . action_id == a . id )
128+ |> join ( :left , [ a ] , fb in subquery ( user_feedbacks ( user ) ) , on: fb . action_id == a . id )
128129 |> where ( [ _ , fb ] , is_nil ( fb . action_id ) )
129130 end
130131
@@ -147,7 +148,7 @@ defmodule CF.Moderation do
147148 query
148149 |> where ( [ a ] , a . user_id != ^ user . id )
149150 |> without_user_feedback ( user )
150- |> join ( :inner , [ a , _ ] , f in Flag , f . action_id == a . id )
151+ |> join ( :inner , [ a , _ ] , f in Flag , on: f . action_id == a . id )
151152 |> group_by ( [ a , _ , _ ] , a . id )
152153 |> being_reported ( )
153154 end
0 commit comments