diff --git a/backend/api/src/get-profiles.ts b/backend/api/src/get-profiles.ts index 4f61377..1aade82 100644 --- a/backend/api/src/get-profiles.ts +++ b/backend/api/src/get-profiles.ts @@ -19,6 +19,7 @@ export type profileQueryType = { wants_kids_strength?: number | undefined, has_kids?: number | undefined, is_smoker?: boolean | undefined, + shortBio?: boolean | undefined, geodbCityIds?: String[] | undefined, compatibleWithUserId?: string | undefined, skipId?: string | undefined, @@ -42,6 +43,7 @@ export const loadProfiles = async (props: profileQueryType) => { wants_kids_strength, has_kids, is_smoker, + shortBio, geodbCityIds, compatibleWithUserId, orderBy: orderByParam = 'created_time', @@ -154,7 +156,7 @@ export const loadProfiles = async (props: profileQueryType) => { {after} ), - where(`bio_length >= ${MIN_BIO_LENGTH}`, {MIN_BIO_LENGTH}), + !shortBio && where(`bio_length >= ${MIN_BIO_LENGTH}`, {MIN_BIO_LENGTH}), lastModificationWithin && where(`last_modification_time >= NOW() - INTERVAL $(lastModificationWithin)`, {lastModificationWithin}), diff --git a/backend/api/src/send-search-notifications.ts b/backend/api/src/send-search-notifications.ts index 17215f0..efa479e 100644 --- a/backend/api/src/send-search-notifications.ts +++ b/backend/api/src/send-search-notifications.ts @@ -53,7 +53,12 @@ export const sendSearchNotifications = async () => { for (const row of searches) { if (typeof row.search_filters !== 'object') continue; - const props = {...row.search_filters, skipId: row.creator_id, lastModificationWithin: '24 hours'} + const props = { + ...row.search_filters, + skipId: row.creator_id, + lastModificationWithin: '24 hours', + shortBio: true, + } const profiles = await loadProfiles(props as profileQueryType) console.debug(profiles.map((item: any) => item.name)) if (!profiles.length) continue diff --git a/common/src/api/schema.ts b/common/src/api/schema.ts index 58fe9bd..c8dd03b 100644 --- a/common/src/api/schema.ts +++ b/common/src/api/schema.ts @@ -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 diff --git a/common/src/filters.ts b/common/src/filters.ts index 3b3cf6b..909d54e 100644 --- a/common/src/filters.ts +++ b/common/src/filters.ts @@ -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 = { is_smoker: undefined, pref_relation_styles: undefined, pref_gender: undefined, + shortBio: undefined, orderBy: 'created_time', } export type OriginLocation = { id: string; name: string } diff --git a/common/src/searches.ts b/common/src/searches.ts index bf0c7db..5727c8c 100644 --- a/common/src/searches.ts +++ b/common/src/searches.ts @@ -53,7 +53,7 @@ export function formatFilters(filters: Partial, 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 diff --git a/web/components/filters/desktop-filters.tsx b/web/components/filters/desktop-filters.tsx index 4f58dff..284cc57 100644 --- a/web/components/filters/desktop-filters.tsx +++ b/web/components/filters/desktop-filters.tsx @@ -13,6 +13,7 @@ import {RelationshipFilter, RelationshipFilterText,} from './relationship-filter import {MyMatchesToggle} from './my-matches-toggle' import {Profile} from 'common/love/profile' import {FilterFields} from "common/filters"; +import {ShortBioToggle} from "web/components/filters/short-bio-toggle"; export function DesktopFilters(props: { filters: Partial @@ -133,6 +134,12 @@ export function DesktopFilters(props: { } popoverClassName="bg-canvas-50" /> + {/* Short Bios */} +