This commit is contained in:
MartinBraquet
2025-09-15 16:13:11 +02:00
parent 8f4c6b911a
commit 9beabc93cd
2 changed files with 8 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ const filterLabels: Record<string, string> = {
pref_age_max: "Max age",
pref_age_min: "Min age",
has_kids: "",
wants_kids_strength: "",
wants_kids_strength: "Kids",
is_smoker: "",
pref_relation_styles: "Seeking",
pref_gender: "",
@@ -93,7 +93,7 @@ function formatFilters(filters: Partial<FilterFields>, location: locationType |
const typedKey = key as keyof FilterFields
if (value === undefined || value === null) return
if (typedKey == 'pref_age_min' || typedKey == 'pref_age_max' || typedKey == 'geodbCityIds') return
if (typedKey == 'pref_age_min' || typedKey == 'pref_age_max' || typedKey == 'geodbCityIds' || typedKey == 'orderBy') return
if (Array.isArray(value) && value.length === 0) return
if (initialFilters[typedKey] === value) return

View File

@@ -3,6 +3,7 @@ import {db} from "web/lib/supabase/db";
import {filterKeys} from "web/components/questions-form";
import {track} from "web/lib/service/analytics";
import {FilterFields} from "web/components/filters/search";
import {removeNullOrUndefinedProps} from "common/util/object";
export const getUserBookmarkedSearches = async (userId: string) => {
@@ -29,7 +30,11 @@ export const submitBookmarkedSearch = async (
if (!filters) return
if (!userId) return
const row = {search_filters: filters, location: locationFilterProps, creator_id: userId}
const row = {
search_filters: removeNullOrUndefinedProps(filters),
location: locationFilterProps?.location ? locationFilterProps : null,
creator_id: userId,
}
const input = {
...filterKeys(row, (key, _) => !['id', 'created_time', 'last_notified_at'].includes(key)),
} as BookmarkedSearchSubmitType