chore(notifications): send notifications to supervisors, but it wont work
This commit is contained in:
parent
ddca9f6688
commit
184ccbc7a6
@ -24,5 +24,11 @@ import Jobs.Handler.SendNotification.Qualification
|
||||
|
||||
|
||||
dispatchJobSendNotification :: UserId -> Notification -> JobHandler UniWorX
|
||||
dispatchJobSendNotification jRecipient jNotification = JobHandlerException $
|
||||
$(dispatchTH ''Notification) jNotification jRecipient
|
||||
dispatchJobSendNotification jRecipient jNotification = JobHandlerException $ do
|
||||
-- TODO: this is a bad idea, since all notifications use jRecipient to generate the message body,
|
||||
-- thus supervisors would receive all notifications with their own name inside!
|
||||
superVs <- runDB $ selectList [UserSupervisorUser ==. jRecipient, UserSupervisorRerouteNotifications ==. True] []
|
||||
if null superVs
|
||||
then $(dispatchTH ''Notification) jNotification jRecipient
|
||||
else forM_ superVs $ \Entity { entityVal = UserSupervisor { userSupervisorSupervisor = svr } } ->
|
||||
$(dispatchTH ''Notification) jNotification svr
|
||||
|
||||
Loading…
Reference in New Issue
Block a user