From 2ba9f98f3873ff2fc44345d74afb6788b2a482e5 Mon Sep 17 00:00:00 2001 From: MahtabBukhari Date: Fri, 22 Nov 2024 13:25:34 +0500 Subject: [PATCH] fix(put-node): update put node request format --- src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx | 2 +- .../SourcesView/Topics/EditTopicModal/index.tsx | 2 +- .../SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx | 2 +- src/types/index.ts | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx b/src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx index 8f1a22810..15ae4d21e 100644 --- a/src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx +++ b/src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx @@ -89,7 +89,7 @@ export const Body = () => { const updatedData = getValues() try { - await putNodeData(node?.ref_id || '', { node_data: updatedData }) + await putNodeData(node?.ref_id || '', { node_type: node?.node_type, node_data: updatedData }) const { updateNode } = useDataStore.getState() diff --git a/src/components/SourcesTableModal/SourcesView/Topics/EditTopicModal/index.tsx b/src/components/SourcesTableModal/SourcesView/Topics/EditTopicModal/index.tsx index de099dabc..03879bba1 100644 --- a/src/components/SourcesTableModal/SourcesView/Topics/EditTopicModal/index.tsx +++ b/src/components/SourcesTableModal/SourcesView/Topics/EditTopicModal/index.tsx @@ -49,7 +49,7 @@ export const EditTopicModal: FC = ({ topic, onClose }) => { setLoading(true) try { - await putNodeData(topic?.ref_id || '', { node_data: { name } }) + await putNodeData(topic?.ref_id, { node_type: topic?.node_type, node_data: { name } }) if (data) { const newData = { ...data } diff --git a/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx b/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx index cacbce342..a655d6738 100644 --- a/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx +++ b/src/components/SourcesTableModal/SourcesView/Topics/Table/TableRow.tsx @@ -45,7 +45,7 @@ const TableRowComponent: FC = ({ setLoading(true) try { - await putNodeData(refId, { node_data: { is_muted: shouldMute } }) + await putNodeData(refId, { node_type: topic?.node_type, node_data: { is_muted: shouldMute } }) useTopicsStore.setState({ ids: ids.filter((i) => i !== refId), diff --git a/src/types/index.ts b/src/types/index.ts index 152948948..9a78d67aa 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -58,6 +58,7 @@ export type RadarRequest = { } export type NodeRequest = { + node_type?: string node_data: { name?: string is_muted?: boolean