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

@@ -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}),

View File

@@ -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