Skip to content

Commit

Permalink
added owned surveys count in select
Browse files Browse the repository at this point in the history
  • Loading branch information
SteRiccio committed Oct 10, 2024
1 parent 2a2be9e commit 4b63b70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/modules/user/repository/userRepository.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ const _usersSelectQuery = ({
SELECT uar.props ->> '${UserAccessRequest.keysProps.country}'
FROM user_access_request uar
WHERE uar.email = u.email
) AS country
) AS country,
(
SELECT COUNT(s.*) FROM survey s WHERE s.owner_uuid = u.uuid
) AS surveys_count_owned
FROM "user" u
${includeSurveys ? `LEFT JOIN user_surveys ON user_surveys.user_uuid = u.uuid` : ''}
LEFT OUTER JOIN us
Expand Down

0 comments on commit 4b63b70

Please sign in to comment.