Skip to content

Commit

Permalink
adding csv data type as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ppratikcr7 committed Nov 4, 2024
1 parent 6bb9138 commit a7e1521
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ export interface ExperimentCSVData {
postRule: string;
enrollmentStartDate: string;
enrollmentCompleteDate: string;
revertTo: string;
payload: string;
excludeIfReached: boolean;
expDecisionPointId: string;
expConditionId: string;
conditionName: string;
revertTo?: string;
payload?: string;
excludeIfReached?: boolean;
expDecisionPointId?: string;
expConditionId?: string;
conditionName?: string;
details: ConditionDecisionPointData[];
}

Expand Down
4 changes: 2 additions & 2 deletions backend/packages/Upgrade/src/api/services/AnalyticsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
SERVER_ERROR,
IExperimentEnrollmentStats,
} from 'upgrade_types';
import { AnalyticsRepository, CSVExportDataRow } from '../repositories/AnalyticsRepository';
import { AnalyticsRepository, CSVExportDataRow, ExperimentCSVData } from '../repositories/AnalyticsRepository';
import { Experiment } from '../models/Experiment';
import ObjectsToCsv from 'objects-to-csv';
import fs from 'fs';
Expand Down Expand Up @@ -183,7 +183,7 @@ export class AnalyticsService {
throw new HttpError(404, `Experiment not found for id: ${experimentId}`);
}
const formattedExperiments = experimentQueryResult.reduce((acc, item) => {
let experiment = acc.find((e) => e.experimentId === item.experimentId);
let experiment: ExperimentCSVData = acc.find((e) => e.experimentId === item.experimentId);
if (!experiment) {
experiment = {
experimentId: item.experimentId,
Expand Down

0 comments on commit a7e1521

Please sign in to comment.