diff --git a/packages/commonwealth/client/scripts/state/api/threads/editThread.ts b/packages/commonwealth/client/scripts/state/api/threads/editThread.ts index da38e3e2e6a..f18ba545161 100644 --- a/packages/commonwealth/client/scripts/state/api/threads/editThread.ts +++ b/packages/commonwealth/client/scripts/state/api/threads/editThread.ts @@ -68,13 +68,16 @@ const editThread = async ({ // for editing thread collaborators collaborators, }: EditThreadProps): Promise => { - const canvasSignedData = await signUpdateThread(address, { - thread_id: threadMsgId, - title: newTitle, - body: newBody, - link: url, - topic: topicId, - }); + let canvasSignedData; + if (newBody || newTitle) { + canvasSignedData = await signUpdateThread(address, { + thread_id: threadMsgId, + title: newTitle, + body: newBody, + link: url, + topic: topicId, + }); + } const response = await axios.patch(`${app.serverUrl()}/threads/${threadId}`, { // common payload diff --git a/packages/commonwealth/client/scripts/views/modals/change_thread_topic_modal.tsx b/packages/commonwealth/client/scripts/views/modals/change_thread_topic_modal.tsx index ca947068523..ed6162832c3 100644 --- a/packages/commonwealth/client/scripts/views/modals/change_thread_topic_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/change_thread_topic_modal.tsx @@ -50,6 +50,7 @@ export const ChangeThreadTopicModal = ({ await editThread({ communityId: app.activeChainId(), address: user.activeAccount?.address || '', + threadMsgId: thread.canvasMsgId, threadId: thread.id, topicId: activeTopic.id, }); diff --git a/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx b/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx index c199c687171..b61fa3ce59c 100644 --- a/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx +++ b/packages/commonwealth/client/scripts/views/modals/edit_collaborators_modal.tsx @@ -51,6 +51,7 @@ export const EditCollaboratorsModal = ({ const { mutateAsync: editThread } = useEditThreadMutation({ communityId: app.activeChainId(), threadId: thread.id, + threadMsgId: thread.canvasMsgId, currentStage: thread.stage, currentTopicId: thread.topic.id, }); diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.tsx b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.tsx index e915631e76c..d2dab1e4efd 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.tsx +++ b/packages/commonwealth/client/scripts/views/pages/discussions/ThreadCard/ThreadOptions/AdminActions/AdminActions.tsx @@ -83,6 +83,7 @@ export const AdminActions = ({ const { mutateAsync: editThread } = useEditThreadMutation({ communityId: app.activeChainId(), threadId: thread.id, + threadMsgId: thread.canvasMsgId, currentStage: thread.stage, currentTopicId: thread.topic?.id, }); diff --git a/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx b/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx index e189964cd28..71cf8da4de2 100644 --- a/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx +++ b/packages/commonwealth/client/scripts/views/pages/view_thread/edit_body.tsx @@ -96,6 +96,7 @@ export const EditBody = (props: EditBodyProps) => { newBody: JSON.stringify(contentDelta) || thread.body, newTitle: title || thread.title, threadId: thread.id, + threadMsgId: thread.canvasMsgId, authorProfile: user.activeAccount?.profile, address: user.activeAccount?.address || '', communityId: app.activeChainId(),