Skip to content

Commit

Permalink
feat: removed old my-expenses page (deprecation) - Part 4 (#2817)
Browse files Browse the repository at this point in the history
* feat: removed old my-expenses page (deprecation) - Part 4

* fix: correction in card filters logic (#2818)
  • Loading branch information
suyashpatil78 authored Mar 11, 2024
1 parent 8f6d6a5 commit b93bf88
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PaymentModeSummary } from 'src/app/core/models/payment-mode-summary.mod
import { AccountType } from 'src/app/core/models/platform/v1/account.model';
import { Expense } from 'src/app/core/models/platform/v1/expense.model';
import { GetExpenseQueryParam } from 'src/app/core/models/platform/v1/get-expenses-query.model';
import { ExpenseFilters } from 'src/app/fyle/my-expenses/expense-filters.model';
import { ExpenseFilters } from 'src/app/fyle/my-expenses/my-expenses-filters.model';
import { DateFilters } from 'src/app/shared/components/fy-filters/date-filters.enum';
import { DateService } from '../../../date.service';

Expand Down
7 changes: 2 additions & 5 deletions src/app/core/services/platform/v1/shared/expenses.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,8 @@ export class ExpensesService {
): Record<string, string | string[] | boolean> {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ describe('CardDetailComponent', () => {
expect(component).toBeTruthy();
});

it('ngOnInit():should set redirection flag', () => {
orgSettingService.get.and.returnValue(of(orgSettingsWithV2ExpensesPage));

expect(component.redirectToNewPage).toBeTrue();
expect(orgSettingService.get).toHaveBeenCalledTimes(1);
});

it('should display the card correctly', () => {
const card = fixture.debugElement.query(By.directive(MockCorporateCardComponent));
expect(card).toBeTruthy();
Expand Down

0 comments on commit b93bf88

Please sign in to comment.