Skip to content

Commit

Permalink
fix(put-node): update put node request format
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtabBukhari committed Nov 22, 2024
1 parent 30f40e1 commit 2ba9f98
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const EditTopicModal: FC<Props> = ({ 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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const TableRowComponent: FC<TTableRaw> = ({
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),
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type RadarRequest = {
}

export type NodeRequest = {
node_type?: string
node_data: {
name?: string
is_muted?: boolean
Expand Down

0 comments on commit 2ba9f98

Please sign in to comment.