From 7515d540cee928aeaf198da38987e9e47de3b2f0 Mon Sep 17 00:00:00 2001 From: iandebruin98 Date: Thu, 21 Nov 2024 11:24:58 +0100 Subject: [PATCH] fix: Add parentId when editing a reply --- packages/comments/src/parts/comment-form.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/comments/src/parts/comment-form.tsx b/packages/comments/src/parts/comment-form.tsx index 5b1a68ed7..789d07cea 100644 --- a/packages/comments/src/parts/comment-form.tsx +++ b/packages/comments/src/parts/comment-form.tsx @@ -62,6 +62,19 @@ function CommentForm({ }); } + if ( + typeof args.comment !== 'undefined' && + typeof args.comment.parentId !== 'undefined' && + !!args.comment.parentId && + activeMode === 'edit' + ) { + formFields.push({ + type: 'hidden', + fieldKey: 'parentId', + defaultValue: args.comment.parentId.toString(), + }); + } + if ( typeof args.comment !== 'undefined' && typeof args.comment.id !== 'undefined' &&