From 786166b448eb2c34ec4b6ce0493737c10aea1cc6 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Tue, 16 Sep 2025 16:14:16 +0200 Subject: [PATCH] Fix connection clause --- backend/api/src/get-profiles.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/api/src/get-profiles.ts b/backend/api/src/get-profiles.ts index 3d6a2854..a09b8871 100644 --- a/backend/api/src/get-profiles.ts +++ b/backend/api/src/get-profiles.ts @@ -28,6 +28,7 @@ export type profileQueryType = { export const loadProfiles = async (props: profileQueryType) => { const pg = createSupabaseDirectClient() + console.log(props) const { limit: limitParam, after, @@ -119,9 +120,10 @@ export const loadProfiles = async (props: profileQueryType) => { where(`age <= $(pref_age_max) or age is null`, {pref_age_max}), pref_relation_styles?.length && - where(`pref_relation_styles && $(pref_relation_styles)`, { - pref_relation_styles, - }), + where( + `pref_relation_styles IS NULL OR pref_relation_styles = '{}' OR pref_relation_styles && $(pref_relation_styles)`, + { pref_relation_styles } + ), !!wants_kids_strength && wants_kids_strength !== -1 &&