From 396f545cf2adfcaa502b614b1ad63100f8c210ff Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Mon, 27 Feb 2023 18:41:02 +0100 Subject: [PATCH] fix(comboadress): provide a valid empty response --- app/javascript/components/shared/queryClient.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/shared/queryClient.ts b/app/javascript/components/shared/queryClient.ts index e356263c1..af7a90116 100644 --- a/app/javascript/components/shared/queryClient.ts +++ b/app/javascript/components/shared/queryClient.ts @@ -75,7 +75,12 @@ const defaultQueryFn: QueryFunction = async ({ // BAN will error with queries less then 3 chars long if (scope == 'adresse' && term.length < 3) { - return []; + return { + type: 'FeatureCollection', + version: 'draft', + features: [], + query: term + }; } const url = buildURL(scope, term, extra);