mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-01-04 11:58:21 -05:00
Clean
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user