fix(firm): show default supervisors with no employees too

This commit is contained in:
Steffen Jost 2023-11-20 15:02:44 +01:00
parent 4fa7385154
commit 0f9a7a8c53

View File

@ -845,7 +845,8 @@ mkFirmSuperTable isAdmin cid = do
where
dbtSQLQuery = \(usr `E.LeftOuterJoin` usrCmp) -> do
EL.on $ usr E.^. UserId E.=?. usrCmp E.?. UserCompanyUser E.&&. usrCmp E.?. UserCompanyCompany E.?=. E.val cid
E.where_ $ E.exists $ firmQuerySupervisedBy cid Nothing usr
E.where_ $ E.isTrue (usrCmp E.?. UserCompanySupervisor)
E.||. E.exists (firmQuerySupervisedBy cid Nothing usr)
return ( usr
, usr & firmCountForSupervisor cid Nothing
, usr & firmCountForSupervisor cid (Just (E.^. UserSupervisorRerouteNotifications))