Skip to content

Commit

Permalink
Merge pull request #696 from openstad/fix/edit-reply-comment
Browse files Browse the repository at this point in the history
fix: Add parentId when editing a reply
  • Loading branch information
iandebruin98 authored Nov 21, 2024
2 parents 0b0f31d + 7515d54 commit c287f61
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/comments/src/parts/comment-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down

0 comments on commit c287f61

Please sign in to comment.