mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-01 09:30:58 -05:00
Add shortBio filter
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user