Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PUT /node request format #2465

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

setActualTopicNode(node)
} catch (error) {
console.log(error)

Check warning on line 64 in src/components/ModalsContainer/EditNodeNameModal/Body/index.tsx

View workflow job for this annotation

GitHub Actions / eslint-run

Unexpected console statement
} finally {
setTopicIsLoading(false)
}
Expand Down Expand Up @@ -89,7 +89,7 @@
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
Loading