Skip to content

Commit

Permalink
fix(data-export): retain index outside of chuck scope (V4-1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashroch committed May 17, 2024
1 parent 99d389d commit 4858d07
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ function dataExportService({
start += batchSize;
}

let currentIndex = 0;

for (const offset of offsets) {
const difference = batchSize + offset - max;
const meals = await SurveySubmissionMeal.findAll({
Expand All @@ -173,7 +175,6 @@ function dataExportService({
const mealId: string[] = [];
const mealIndex: Record<string, number> = {};

let currentIndex = 0;
const mealCount = meals.length;
meals.forEach(({ id, surveySubmissionId }, index, array) => {
mealId.push(id);
Expand Down

0 comments on commit 4858d07

Please sign in to comment.