Skip to content

Commit 8e730e4

Browse files
committed
fix: type error
1 parent 5af11af commit 8e730e4

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

apps/nestjs-backend/src/features/plugin-panel/plugin-panel.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Module } from '@nestjs/common';
22
import { BaseModule } from '../base/base.module';
33
import { CollaboratorModule } from '../collaborator/collaborator.module';
4+
import { ChartService } from '../dashboard/chart.service';
45
import { DashboardModule } from '../dashboard/dashboard.module';
56
import { PluginPanelController } from './plugin-panel.controller';
67
import { PluginPanelService } from './plugin-panel.service';
7-
import { ChartService } from '../dashboard/chart.service';
88

99
@Module({
1010
imports: [CollaboratorModule, BaseModule, DashboardModule],

apps/nextjs-app/src/features/app/blocks/chart-v2/components/DataConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const DataConfig = () => {
2020
<span>{t('chartV2.form.name')}</span>
2121
<Input
2222
className="h-9"
23-
defaultValue={pluginName}
23+
defaultValue={pluginName as string}
2424
onBlur={(e) => renamePlugin(e.target.value)}
2525
/>
2626
</div>

apps/nextjs-app/src/features/app/blocks/chart-v2/hooks/usePluginInstall.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
updatePluginPanelStorage,
1010
} from '@teable/openapi';
1111
import { ReactQueryKeys } from '@teable/sdk/config';
12+
import { useCallback } from 'react';
1213
import { useEnv } from './useEnv';
1314

1415
export const usePluginInstall = () => {
@@ -73,19 +74,33 @@ export const usePluginInstall = () => {
7374
},
7475
});
7576

77+
const updateDashboardPluginStorageFn = useCallback(
78+
(storage: IChartStorage) => {
79+
updateDashboardPluginStorageMutate(storage);
80+
},
81+
[updateDashboardPluginStorageMutate]
82+
);
83+
84+
const updatePluginPanelPluginStorageFn = useCallback(
85+
(storage: IChartStorage) => {
86+
updatePluginPanelPluginStorageMutate(storage);
87+
},
88+
[updatePluginPanelPluginStorageMutate]
89+
);
90+
7691
if (positionType === PluginPosition.Dashboard) {
7792
return {
7893
pluginInstall: dashboardPluginInstall,
7994
isLoading: isDashboardPluginInstallLoading,
8095
renamePlugin: renamePluginMutate,
81-
updatePluginStorage: updateDashboardPluginStorageMutate,
96+
updatePluginStorage: updateDashboardPluginStorageFn,
8297
};
8398
}
8499

85100
return {
86101
pluginInstall: pluginPanelPluginInstall,
87102
isLoading: isPluginPanelPluginLoading,
88103
renamePlugin: renamePluginMutate,
89-
updatePluginStorage: updatePluginPanelPluginStorageMutate,
104+
updatePluginStorage: updatePluginPanelPluginStorageFn,
90105
};
91106
};

0 commit comments

Comments
 (0)