From 46726d4855dbcc2f8eef79e148dcd006851ee563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 2 Feb 2024 18:00:01 +0100 Subject: [PATCH] fix: size on filters --- webapp-next/utils/api.ts | 3 +-- webapp-next/utils/tools.ts | 21 +++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/webapp-next/utils/api.ts b/webapp-next/utils/api.ts index ba386ed..01a842b 100644 --- a/webapp-next/utils/api.ts +++ b/webapp-next/utils/api.ts @@ -88,8 +88,7 @@ export function useDepartments(departments: string[]) { index: 'cm2d_departments', filters: JSON.stringify({ terms: { - department: departments, - size: 100 + department: departments } }) }; diff --git a/webapp-next/utils/tools.ts b/webapp-next/utils/tools.ts index 7d43d2e..b2fd49a 100644 --- a/webapp-next/utils/tools.ts +++ b/webapp-next/utils/tools.ts @@ -269,14 +269,12 @@ export function transformFilters(filters: Filters): any[] { should: [ { terms: { - categories_level_1: filters.categories, - size: 100 + categories_level_1: filters.categories } }, { terms: { - categories_level_2: filters.categories, - size: 100 + categories_level_2: filters.categories } } ], @@ -287,16 +285,14 @@ export function transformFilters(filters: Filters): any[] { case 'category_1': transformed.push({ terms: { - categories_level_1: filters.categories, - size: 100 + categories_level_1: filters.categories } }); break; case 'category_2': transformed.push({ terms: { - categories_level_2: filters.categories, - size: 100 + categories_level_2: filters.categories } }); break; @@ -339,8 +335,7 @@ export function transformFilters(filters: Filters): any[] { if (filters.sex.length > 0) { transformed.push({ terms: { - sex: filters.sex, - size: 100 + sex: filters.sex } }); } @@ -348,8 +343,7 @@ export function transformFilters(filters: Filters): any[] { if (filters.death_location.length > 0) { transformed.push({ terms: { - death_location: filters.death_location, - size: 100 + death_location: filters.death_location } }); } @@ -359,8 +353,7 @@ export function transformFilters(filters: Filters): any[] { home_department: filters.department.length > 0 ? filters.department - : filters.region_departments, - size: 100 + : filters.region_departments } });