Skip to content

Commit

Permalink
Update processTrackUtils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish-egov authored Jul 24, 2024
1 parent c8740c8 commit 25cd61d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import config from './../config';
import { produceModifiedMessages } from '../kafka/Listener';
import { v4 as uuidv4 } from 'uuid';
import { executeQuery } from './db';
import { processTrackStatuses, processTrackTypes } from '../config/constants';
import { processTrackForUi, processTrackStatuses, processTrackTypes } from '../config/constants';
import { logger } from './logger';

async function getProcessDetails(id: string, type?: string): Promise<any[]> {
Expand Down Expand Up @@ -32,12 +32,13 @@ async function getProcessDetails(id: string, type?: string): Promise<any[]> {
logger.info('No process details found');
return [];
}

const uiSet = new Set(processTrackForUi.map((item: any) => item));
return queryResponse.rows.map((result: any) => ({
id: result.id,
campaignId: result.campaignid,
type: result.type,
status: result.status,
showInUi: uiSet.has(result.type),
details: result.details,
additionalDetails: result.additionaldetails,
createdTime: parseInt(result.createdtime, 10),
Expand Down

0 comments on commit 25cd61d

Please sign in to comment.