From 8b6a48f05cbfd269ec0be98fb1dc389dd6df1612 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:08:21 +0530 Subject: [PATCH] fix: don't add as a sub-issue if parent has been removed (#4731) --- web/components/issues/sub-issues/root.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/components/issues/sub-issues/root.tsx b/web/components/issues/sub-issues/root.tsx index b697ff20a..45d6119c1 100644 --- a/web/components/issues/sub-issues/root.tsx +++ b/web/components/issues/sub-issues/root.tsx @@ -462,7 +462,9 @@ export const SubIssuesRoot: FC = observer((props) => { toggleCreateIssueModal(false); }} onSubmit={async (_issue: TIssue) => { - await subIssueOperations.addSubIssue(workspaceSlug, projectId, parentIssueId, [_issue.id]); + if (_issue.parent_id) { + await subIssueOperations.addSubIssue(workspaceSlug, projectId, parentIssueId, [_issue.id]); + } }} /> )}