From dd311c6964a5465b678ff73f313d5b513479f44d Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal Date: Wed, 24 Jul 2024 18:24:58 +0530 Subject: [PATCH] fix: issue parent type --- packages/types/src/issues/issue.d.ts | 2 +- web/core/hooks/use-group-dragndrop.ts | 2 +- web/helpers/issue.helper.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/types/src/issues/issue.d.ts b/packages/types/src/issues/issue.d.ts index c9cd133ef06..3b901f57e0c 100644 --- a/packages/types/src/issues/issue.d.ts +++ b/packages/types/src/issues/issue.d.ts @@ -42,7 +42,7 @@ export type TBaseIssue = { export type TIssue = TBaseIssue & { description_html?: string; is_subscribed?: boolean; - parent?: Partial; + parent?: Partial; issue_reactions?: TIssueReaction[]; issue_attachment?: TIssueAttachment[]; issue_link?: TIssueLink[]; diff --git a/web/core/hooks/use-group-dragndrop.ts b/web/core/hooks/use-group-dragndrop.ts index 621a9dc7cf0..4cf0b900135 100644 --- a/web/core/hooks/use-group-dragndrop.ts +++ b/web/core/hooks/use-group-dragndrop.ts @@ -65,7 +65,7 @@ export const useGroupIssuesDragNDrop = ( if (isCycleChanged && workspaceSlug) { if (data[cycleKey]) { - addCycleToIssue(workspaceSlug.toString(), projectId, data[cycleKey], issueId).catch(() => + addCycleToIssue(workspaceSlug.toString(), projectId, data[cycleKey]?.toString() ?? "", issueId).catch(() => setToast(errorToastProps) ); } else { diff --git a/web/helpers/issue.helper.ts b/web/helpers/issue.helper.ts index 6cf6588e4eb..7482ca75e4c 100644 --- a/web/helpers/issue.helper.ts +++ b/web/helpers/issue.helper.ts @@ -1,4 +1,5 @@ import differenceInCalendarDays from "date-fns/differenceInCalendarDays"; +import set from "lodash/set"; import { v4 as uuidv4 } from "uuid"; // types import { @@ -184,7 +185,7 @@ export function getChangedIssuefields(formData: Partial, dirtyFields: { const dirtyFieldKeys = Object.keys(dirtyFields) as (keyof TIssue)[]; for (const dirtyField of dirtyFieldKeys) { if (!!dirtyFields[dirtyField]) { - changedFields[dirtyField] = formData[dirtyField]; + set(changedFields, [dirtyField], formData[dirtyField]); } } @@ -304,4 +305,4 @@ export const getComputedDisplayProperties = ( updated_on: displayProperties?.updated_on ?? true, modules: displayProperties?.modules ?? true, cycle: displayProperties?.cycle ?? true, -}); \ No newline at end of file +});