ui: fix metadata prefetch

This commit is contained in:
nick-delirium 2025-01-21 11:35:34 +01:00
parent e405f01149
commit cc829263b3
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -18,8 +18,9 @@ export default class FilterStore {
makeAutoObservable(this);
}
setTopValues = (key: string, values: TopValue[]) => {
this.topValues[key] = values?.filter((value) => value !== null && value.value !== '');
setTopValues = (key: string, values: Record<string, any> | TopValue[]) => {
const vals = Array.isArray(values) ? values : values.data
this.topValues[key] = vals?.filter((value) => value !== null && value.value !== '');
};
fetchTopValues = async (key: string, source?: string) => {