Skip to content

Commit

Permalink
MNTOR-3723 - Fix wrong state for users for email data point count
Browse files Browse the repository at this point in the history
  • Loading branch information
codemist committed Oct 28, 2024
1 parent 25387c8 commit e1562ae
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/emails/functions/reduceSanitizedDataPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ import { SanitizedDataPoints } from "../../app/functions/server/dashboard";
export function calculateSanitizedDataPoints(
data: SanitizedDataPoints,
): number {
return data.reduce(
(accumulatedValue: number, currentDataPoint: Record<string, number>) => {
const dataPointValue = Object.values(currentDataPoint)[0] as number;
return accumulatedValue + dataPointValue;
},
0,
);
return data.reduce((accumulatedValue, currentDataPoint) => {

Check failure on line 11 in src/emails/functions/reduceSanitizedDataPoints.ts

View workflow job for this annotation

GitHub Actions / npm-lint

Parameter 'accumulatedValue' implicitly has an 'any' type.

Check failure on line 11 in src/emails/functions/reduceSanitizedDataPoints.ts

View workflow job for this annotation

GitHub Actions / npm-lint

Parameter 'currentDataPoint' implicitly has an 'any' type.
const dataPointValue = Object.values(currentDataPoint)[0] as number;
return accumulatedValue + dataPointValue;
}, 0);
}

0 comments on commit e1562ae

Please sign in to comment.