Исправлена модель виджета дашборда

This commit is contained in:
Pavel Gnedov 2023-10-06 08:26:55 +07:00
parent 6e2fc1de6c
commit 05b6364ae5
2 changed files with 4 additions and 6 deletions

View file

@ -1,9 +1,7 @@
import axios from 'axios';
import { Instance, types } from 'mobx-state-tree';
type _WidgetParams = {
collapsed?: boolean;
} & Record<string, any>;
type _WidgetParams = Record<string, any> | null;
export const WidgetParams = types.frozen<_WidgetParams>();
@ -15,6 +13,7 @@ export const Widget = types.model({
type: types.string,
id: types.string,
title: types.string,
collapsed: types.maybe(types.boolean),
widgetParams: types.maybe(WidgetParams),
dataLoaderParams: types.maybe(DataLoaderParams),
});

View file

@ -11,9 +11,7 @@ export type Dashboard = {
/**
* Параметры для отрисовки данных
*/
export type WidgetParams = {
collapsed?: boolean;
} & Record<string, any>;
export type WidgetParams = Record<string, any> | null;
/**
* Параметры для загрузки данных
@ -24,6 +22,7 @@ export type Widget = {
type: string;
id: string;
title: string;
collapsed?: boolean;
widgetParams?: WidgetParams;
dataLoaderParams?: DataLoaderParams;
};