From ff97921ef810baca451b3a7f73f28d884f79c420 Mon Sep 17 00:00:00 2001 From: pablopupulin Date: Tue, 29 Oct 2024 09:55:52 -0300 Subject: [PATCH 1/3] Set viewedByCustomer is false, where is null --- node/resolvers/mutations/index.ts | 4 ++-- node/utils/Queue.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/node/resolvers/mutations/index.ts b/node/resolvers/mutations/index.ts index adde038..5da1f2e 100644 --- a/node/resolvers/mutations/index.ts +++ b/node/resolvers/mutations/index.ts @@ -290,8 +290,8 @@ export const Mutation = { status, subtotal: subtotal ?? existingQuote.subtotal, updateHistory, - viewedByCustomer: decline || isCustomer, - viewedBySales: decline || isSales, + viewedByCustomer: !!(decline || isCustomer), + viewedBySales: !!(decline || isSales), } const data = await masterdata diff --git a/node/utils/Queue.ts b/node/utils/Queue.ts index 9f142e9..b2872c1 100644 --- a/node/utils/Queue.ts +++ b/node/utils/Queue.ts @@ -14,6 +14,10 @@ const processItem = ({ ctx, item }: { ctx: Context; item: Quote }) => { return } + if (item.viewedByCustomer === null) { + item.viewedByCustomer = false; + } + const status = 'expired' const now = new Date() const nowISO = now.toISOString() From 90e052e7f56f45d19102b57a26335ac10b5f2809 Mon Sep 17 00:00:00 2001 From: pablopupulin Date: Tue, 29 Oct 2024 10:00:51 -0300 Subject: [PATCH 2/3] Add Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf18081..0159e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Set viewedByCustomer value False when value is null + ## [2.6.2] - 2024-10-02 ### Added From 8cb2ab9dee5b43428339373f51bc494d8b075a26 Mon Sep 17 00:00:00 2001 From: pablopupulin Date: Tue, 29 Oct 2024 10:06:00 -0300 Subject: [PATCH 3/3] Fix LINT --- node/utils/Queue.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/utils/Queue.ts b/node/utils/Queue.ts index b2872c1..d798b26 100644 --- a/node/utils/Queue.ts +++ b/node/utils/Queue.ts @@ -15,7 +15,7 @@ const processItem = ({ ctx, item }: { ctx: Context; item: Quote }) => { } if (item.viewedByCustomer === null) { - item.viewedByCustomer = false; + item.viewedByCustomer = false } const status = 'expired'