From 2a3cc80dcc901ccb9b2625f5ee7fcc47c1cc8c75 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 6 Apr 2023 11:06:28 +0300 Subject: [PATCH] fix load-kp caches values (WTF?) --- apps/web/server/routers/quote/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/web/server/routers/quote/index.ts b/apps/web/server/routers/quote/index.ts index fb01861..999260f 100644 --- a/apps/web/server/routers/quote/index.ts +++ b/apps/web/server/routers/quote/index.ts @@ -71,10 +71,7 @@ export const quoteRouter = router({ ].map(({ getKPData }) => getKPData(input)) ); - const values = processData.reduce( - (obj, data) => Object.assign(obj, data.values), - defaultValues - ); + const values = processData.reduce((obj, data) => ({ ...obj, ...data.values }), defaultValues); const payments = processData.find((x) => x.payments)?.payments ?? defaultPayments; const insurance = processData.find((x) => x.insurance)?.insurance ?? defaultInsurance; const fingap = processData.find((x) => x.fingap)?.fingap ?? defaultFingap;