From cfec0020ada280399920c2fdb92ba5d9a6d06721 Mon Sep 17 00:00:00 2001 From: Dominik Broj Date: Thu, 9 May 2024 10:15:50 +0200 Subject: [PATCH] Handle empty values in convertFiltersToBackendFormat (#4326) # What this PR does Handle empty values in convertFiltersToBackendFormat ## Which issue(s) this PR closes Broken Insights page ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes. --- grafana-plugin/src/models/filters/filters.helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grafana-plugin/src/models/filters/filters.helpers.ts b/grafana-plugin/src/models/filters/filters.helpers.ts index ba4a0372..531055a6 100644 --- a/grafana-plugin/src/models/filters/filters.helpers.ts +++ b/grafana-plugin/src/models/filters/filters.helpers.ts @@ -12,7 +12,7 @@ export const getApiPathByPage = (page: string) => { ); }; -export const convertFiltersToBackendFormat = (filters: FiltersValues, filterOptions: FilterOption[]) => { +export const convertFiltersToBackendFormat = (filters: FiltersValues = {}, filterOptions: FilterOption[] = []) => { const newFilters = { ...filters }; filterOptions.forEach((filterOption) => { if (filterOption.type === 'daterange' && newFilters[filterOption.name]) {