From 93d40d8d297bc8e3390a9c7cba4b403515a1460c Mon Sep 17 00:00:00 2001 From: sora-ext Date: Tue, 4 Mar 2025 17:19:22 +0100 Subject: [PATCH] Update src/client/api.ts --- src/client/api.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/client/api.ts b/src/client/api.ts index a1dee6b..f85a876 100644 --- a/src/client/api.ts +++ b/src/client/api.ts @@ -141,7 +141,7 @@ export const icon_type = (item: string | NominatimResult): string => { "nature_reserve", ], "dice-five": ["water_park", "theme_park", "casino"], - "": ["?", "neighbourhood", "quarter", "highway"], + "": ["?", "neighbourhood", "quarter", "highway", "place"], }; for (let k in types) { @@ -150,3 +150,13 @@ export const icon_type = (item: string | NominatimResult): string => { console.log(item.display_name, item.category, item.type); return "question"; }; + +export const get_filter = function (f: string) { + switch (f) { + case "hotel": return is_hotel_type; + case "restaurant": return is_restauration_type; + case "place": return is_attraction_type; + case "other": + default: return () => true; + } +}