diff --git a/src/server/repository/public/user/utils/getPropsToQueryParams.ts b/src/server/repository/public/user/utils/getPropsToQueryParams.ts index 1a9d410c49..fd8a51337f 100644 --- a/src/server/repository/public/user/utils/getPropsToQueryParams.ts +++ b/src/server/repository/public/user/utils/getPropsToQueryParams.ts @@ -10,10 +10,16 @@ type Returned = { whereConditions: Array; queryParams: UserQueryParams } export const getPropsToQueryParams = (props: UsersGetManyProps): Returned => { const { countryIso, filters = {}, limit, offset } = props - const { administrators, countries, fullName, roles, disabled } = filters + const { + administrators, + countries, + fullName, + roles, + disabled, + statuses: defaultStatuses = [UserStatus.active], + } = filters // Only return users with active status, unless other statuses specified outside - const defaultStatuses = props.filters.statuses ?? [UserStatus.active] const statuses = disabled ? [UserStatus.disabled] : defaultStatuses const queryParams: UserQueryParams = {}