From 0b4faf7db2e4166204be12c4aefde78bca95ded5 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Tue, 18 Jun 2024 20:21:13 +0530 Subject: [PATCH] [WEB-1642] chore: mutating issue estimation_point when we delete the estimate point from the project (#4862) * chore: mutating issue estimation_point when we delete the eatimate point from the project * chore: updated try catch * chore: updated removed issues length check on estimate delete --- web/core/store/estimates/estimate.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web/core/store/estimates/estimate.ts b/web/core/store/estimates/estimate.ts index 1c7693363..a37176b84 100644 --- a/web/core/store/estimates/estimate.ts +++ b/web/core/store/estimates/estimate.ts @@ -273,10 +273,19 @@ export class Estimate implements IEstimate { newEstimatePointId ? { new_estimate_id: newEstimatePointId } : undefined ); + const currentIssues = Object.values(this.store.issue.issues.issuesMap || {}); + if (currentIssues) { + currentIssues.map((issue) => { + if (issue.estimate_point === estimatePointId) { + this.store.issue.issues.updateIssue(issue.id, { estimate_point: newEstimatePointId }); + } + }); + } + runInAction(() => { unset(this.estimatePoints, [estimatePointId]); }); - if (deleteEstimatePoint && deleteEstimatePoint.length > 0) { + if (deleteEstimatePoint) { runInAction(() => { deleteEstimatePoint.map((estimatePoint) => { if (estimatePoint.id)