Enrich filters with all types (#2653)

This commit is contained in:
Charles Bochet
2023-11-22 17:23:10 +01:00
committed by GitHub
parent 0fd823af21
commit 8f12aea64a
20 changed files with 315 additions and 111 deletions

View File

@ -166,7 +166,7 @@ export const useViewFilters = (viewScopeId: string) => {
filter.fieldMetadataId === filterToUpsert.fieldMetadataId,
);
if (existingFilterIndex === -1) {
if (existingFilterIndex === -1 && filterToUpsert.value !== '') {
filtersDraft.push({
...filterToUpsert,
id: existingSavedFilterId,
@ -174,6 +174,11 @@ export const useViewFilters = (viewScopeId: string) => {
return filtersDraft;
}
if (filterToUpsert.value === '') {
filtersDraft.splice(existingFilterIndex, 1);
return filtersDraft;
}
filtersDraft[existingFilterIndex] = {
...filterToUpsert,
id: existingSavedFilterId,