fix: 修复变更面板类型不会更新的bug

pull/56/head
moonrailgun 3 years ago
parent 1cd533f8ce
commit e7eea31a46

@ -285,6 +285,7 @@ export async function modifyGroupPanel(
panelId: string,
options: {
name: string;
type: number;
parentId?: string;
provider?: string;
pluginPanelName?: string;

@ -1,9 +1,9 @@
{
"label": "posthog",
"name": "com.msgbyte.posthog",
"url": "/plugins/com.msgbyte.posthog/index.js",
"version": "0.0.0",
"author": "moonrailgun",
"description": "Posthog 数据统计",
"requireRestart": true
}
{
"label": "Posthog",
"name": "com.msgbyte.posthog",
"url": "/plugins/com.msgbyte.posthog/index.js",
"version": "0.0.0",
"author": "moonrailgun",
"description": "Posthog 数据统计",
"requireRestart": true
}

@ -42,7 +42,7 @@ export const ModalModifyGroupPanel: React.FC<{
await modifyGroupPanel(
props.groupId,
props.groupPanelId,
_omit(buildDataFromValues(values), 'type') // 发送时不传type
buildDataFromValues(values)
);
showToasts(t('修改成功'), 'success');
typeof props.onSuccess === 'function' && props.onSuccess();

@ -112,6 +112,7 @@ class GroupService extends TcService {
groupId: 'string',
panelId: 'string',
name: 'string',
type: 'number',
provider: { type: 'string', optional: true },
pluginPanelName: { type: 'string', optional: true },
meta: { type: 'object', optional: true },
@ -640,12 +641,13 @@ class GroupService extends TcService {
groupId: string;
panelId: string;
name: string;
type: number;
provider?: string;
pluginPanelName?: string;
meta?: object;
}>
) {
const { groupId, panelId, name, provider, pluginPanelName, meta } =
const { groupId, panelId, name, type, provider, pluginPanelName, meta } =
ctx.params;
const { t, userId } = ctx.meta;
@ -666,6 +668,7 @@ class GroupService extends TcService {
{
$set: {
'panels.$[element].name': name,
'panels.$[element].type': type,
'panels.$[element].provider': provider,
'panels.$[element].pluginPanelName': pluginPanelName,
'panels.$[element].meta': meta,

Loading…
Cancel
Save