Skip to content

Commit

Permalink
fix: fixed comment update issue:
Browse files Browse the repository at this point in the history
  • Loading branch information
sundasnoreen12 committed Jul 4, 2024
1 parent c7b7f8e commit 9330fcf
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ const CommentEditor = ({
};

const saveUpdatedComment = useCallback(async (values, { resetForm }) => {
const clonedValues = { ...values };
clonedValues.comment = editorContent;
if (id) {
const payload = {
...values,
editReasonCode: values.editReasonCode || undefined,
...clonedValues,
editReasonCode: clonedValues.editReasonCode || undefined,
};
await dispatch(editComment(id, payload));
} else {
await dispatch(addComment(values.comment, threadId, parentId, enableInContextSidebar));
await dispatch(addComment(clonedValues.comment, threadId, parentId, enableInContextSidebar));
}
/* istanbul ignore if: TinyMCE is mocked so this cannot be easily tested */
if (editorRef.current) {
Expand Down

0 comments on commit 9330fcf

Please sign in to comment.