Skip to content

Commit

Permalink
Merge pull request #2465 from MahtabBukhari/Update-PUT-node-request-f…
Browse files Browse the repository at this point in the history
…ormat

Update PUT /node request format
  • Loading branch information
Rassl authored Dec 16, 2024
2 parents c83a8fe + 2ba9f98 commit f7a801d
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 @@ -60,6 +60,7 @@ export type RadarRequest = {
}

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

0 comments on commit f7a801d

Please sign in to comment.