diff --git a/packages/central-server/src/apiV2/postChanges.js b/packages/central-server/src/apiV2/postChanges.js index eacfde1da4..e619ae1307 100644 --- a/packages/central-server/src/apiV2/postChanges.js +++ b/packages/central-server/src/apiV2/postChanges.js @@ -69,6 +69,8 @@ export async function postChanges(req, res) { await ACTION_HANDLERS[action](models, translatedPayload); if (action === SUBMIT_SURVEY_RESPONSE) { + // TODO: Rework this functionality, as directly calling an analytics refresh here is both inefficient + // and may create duplicate records in the analytics table const { waitForAnalyticsRebuild } = rest; if (waitForAnalyticsRebuild) { const { database } = models; diff --git a/packages/central-server/src/apiV2/surveyResponses/DeleteSurveyResponses.js b/packages/central-server/src/apiV2/surveyResponses/DeleteSurveyResponses.js index 0bd5f41ac2..cbe0da7561 100644 --- a/packages/central-server/src/apiV2/surveyResponses/DeleteSurveyResponses.js +++ b/packages/central-server/src/apiV2/surveyResponses/DeleteSurveyResponses.js @@ -38,6 +38,8 @@ export class DeleteSurveyResponses extends DeleteHandler { await super.deleteRecord(); if (this.req.query.waitForAnalyticsRebuild === 'true') { + // TODO: Rework this functionality, as directly calling an analytics refresh here is both inefficient + // and may create duplicate records in the analytics table const { database } = this.models; await AnalyticsRefresher.refreshAnalytics(database); }