From 08f663a7702da73ffb0b8d58a42260832c015bd7 Mon Sep 17 00:00:00 2001 From: suyashpatil78 Date: Sat, 9 Mar 2024 15:50:21 +0530 Subject: [PATCH] fix: correction in card filters logic --- .../core/services/platform/v1/shared/expenses.service.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/core/services/platform/v1/shared/expenses.service.ts b/src/app/core/services/platform/v1/shared/expenses.service.ts index 86266524cf..12558329ea 100644 --- a/src/app/core/services/platform/v1/shared/expenses.service.ts +++ b/src/app/core/services/platform/v1/shared/expenses.service.ts @@ -200,11 +200,8 @@ export class ExpensesService { ): Record { const newQueryParamsCopy = cloneDeep(newQueryParams); if (filters.cardNumbers?.length > 0) { - let cardNumberString = ''; - cardNumberString = filters.cardNumbers.join(','); - cardNumberString = cardNumberString.slice(0, cardNumberString.length); - newQueryParamsCopy['matched_corporate_card_transactions->0->corporate_card_number'] = - 'in.(' + cardNumberString + ')'; + const cardNumberString = filters.cardNumbers.map((cardNumber) => `"${cardNumber}"`).join(','); + newQueryParamsCopy['matched_corporate_card_transactions->0->corporate_card_number'] = `in.(${cardNumberString})`; } return newQueryParamsCopy;