Add shortBio filter

This commit is contained in:
MartinBraquet
2025-10-10 19:03:57 +02:00
parent 015fe76c44
commit e2be3aafcd
7 changed files with 53 additions and 3 deletions

View File

@@ -321,6 +321,7 @@ export const API = (_apiTypeCheck = {
wants_kids_strength: z.coerce.number().optional(),
has_kids: z.coerce.number().optional(),
is_smoker: z.coerce.boolean().optional(),
shortBio: z.coerce.boolean().optional(),
geodbCityIds: arraybeSchema.optional(),
compatibleWithUserId: z.string().optional(),
orderBy: z

View File

@@ -7,6 +7,7 @@ export type FilterFields = {
geodbCityIds: string[] | null
genders: string[]
name: string | undefined
shortBio: boolean | undefined
} & Pick<
ProfileRow,
| 'wants_kids_strength'
@@ -47,6 +48,7 @@ export const initialFilters: Partial<FilterFields> = {
is_smoker: undefined,
pref_relation_styles: undefined,
pref_gender: undefined,
shortBio: undefined,
orderBy: 'created_time',
}
export type OriginLocation = { id: string; name: string }

View File

@@ -53,7 +53,7 @@ export function formatFilters(filters: Partial<FilterFields>, location: location
const typedKey = key as keyof FilterFields
if (value === undefined || value === null) return
if (typedKey == 'pref_age_min' || typedKey == 'pref_age_max' || typedKey == 'geodbCityIds' || typedKey == 'orderBy') return
if (typedKey == 'pref_age_min' || typedKey == 'pref_age_max' || typedKey == 'geodbCityIds' || typedKey == 'orderBy' || typedKey == 'shortBio') return
if (Array.isArray(value) && value.length === 0) return
if (initialFilters[typedKey] === value) return