From 2d6210e0fdb08f7dee6d98fd997be107fb684e99 Mon Sep 17 00:00:00 2001 From: Mitan Omar Date: Tue, 9 Jan 2024 16:42:16 +0100 Subject: [PATCH] fix: updating the customer, project, task in analysis edit report page --- app/validators/intersection-task.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/validators/intersection-task.js b/app/validators/intersection-task.js index eff4901fc..8a5261e49 100644 --- a/app/validators/intersection-task.js +++ b/app/validators/intersection-task.js @@ -2,11 +2,13 @@ export default function validateIntersectionTask() { return (key, newValue, oldValue, changes, content) => { const customerChanged = Object.keys(changes).includes("customer") && - (changes.customer.id || null) !== (content.customer.id || null); + (changes.customer?.get("id") || null) !== + (content.customer?.get("id") || null); const projectChanged = Object.keys(changes).includes("project") && - (changes.project.id || null) !== (content.project.id || null); + (changes.project?.get("id") || null) !== + (content.project?.get("id") || null); const hasTask = !!(newValue && newValue.id);