diff --git a/app/api/profiles/route.ts b/app/api/profiles/route.ts index 1c5634e6..78d32f27 100644 --- a/app/api/profiles/route.ts +++ b/app/api/profiles/route.ts @@ -8,6 +8,8 @@ export async function GET(request: Request) { const gender = url.searchParams.get("gender"); const minAge = url.searchParams.get("minAge"); const maxAge = url.searchParams.get("maxAge"); + const minIntroversion = url.searchParams.get("minIntroversion"); + const maxIntroversion = url.searchParams.get("maxIntroversion"); const interests = url.searchParams.get("interests")?.split(",").filter(Boolean) || []; const causeAreas = url.searchParams.get("causeAreas")?.split(",").filter(Boolean) || []; const connections = url.searchParams.get("connections")?.split(",").filter(Boolean) || []; @@ -48,6 +50,22 @@ export async function GET(request: Request) { } } + // Add introversion filtering + if (minIntroversion || maxIntroversion) { + where.profile = { + ...where.profile, + introversion: {} + }; + + if (minIntroversion) { + where.profile.introversion.gte = parseInt(minIntroversion); + } + + if (maxIntroversion) { + where.profile.introversion.lte = parseInt(maxIntroversion); + } + } + // OR // if (interests.length > 0) { // where.profile = { diff --git a/app/complete-profile/page.tsx b/app/complete-profile/page.tsx index b5a0abb6..100250a2 100644 --- a/app/complete-profile/page.tsx +++ b/app/complete-profile/page.tsx @@ -26,6 +26,7 @@ function RegisterComponent() { const [name, setName] = useState(''); const [gender, setGender] = useState(''); const [age, setAge] = useState(null); + const [introversion, setIntroversion] = useState(null); const [personalityType, setPersonalityType] = useState(''); const [conflictStyle, setConflictStyle] = useState(''); const [image, setImage] = useState(''); @@ -74,6 +75,7 @@ function RegisterComponent() { setGender(profile.gender || ''); setPersonalityType(profile.personalityType || null); setConflictStyle(profile.conflictStyle || ''); + setIntroversion(profile.introversion || null); if (profile.birthYear) { setAge(new Date().getFullYear() - profile.birthYear); } @@ -315,6 +317,7 @@ function RegisterComponent() { location, gender: gender as Gender, ...(age && {birthYear: new Date().getFullYear() - age}), + introversion, personalityType: personalityType as PersonalityType, conflictStyle: conflictStyle as ConflictStyle, images: keys, @@ -592,49 +595,9 @@ function RegisterComponent() { -
- - -
- -
- - -
-
@@ -754,6 +717,63 @@ function RegisterComponent() {
+
+ + setIntroversion(Number(e.target.value))} + className="appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm" + // placeholder="" + /> +
+ + {/*
*/} + {/* */} + {/* setPersonalityType(e.target.value as PersonalityType)}*/} + {/* className="appearance-none rounded-md relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 focus:z-10 sm:text-sm"*/} + {/* >*/} + {/* */} + {/* {personalityOptions.map((type) => (*/} + {/* */} + {/* ))}*/} + {/* */} + {/*
*/} + +
+ + +
+