From 11de3b0fe1e6b2558c3ccc3aff84d5ad48861e0d Mon Sep 17 00:00:00 2001 From: Andrew Hyndman Date: Thu, 6 Jun 2024 10:57:49 -0400 Subject: [PATCH] fix: ensure uploads are sorted when fetched from DB (#3134) Co-authored-by: Andrew Hyndman --- packages/server/src/arpa_reporter/db/uploads.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/arpa_reporter/db/uploads.js b/packages/server/src/arpa_reporter/db/uploads.js index f0317d068..fa9655ec0 100644 --- a/packages/server/src/arpa_reporter/db/uploads.js +++ b/packages/server/src/arpa_reporter/db/uploads.js @@ -64,7 +64,8 @@ function usedForTreasuryExport(periodId, tenantId = useTenantId(), trns = knex) .andOn('uploads.agency_id', '=', 'agency_max_val.agency_id') .andOn('uploads.ec_code', '=', 'agency_max_val.ec_code') .andOn('uploads.reporting_period_id', '=', 'agency_max_val.reporting_period_id'); - }); + }) + .orderBy('created_at', 'asc'); } /* getUploadSummaries() returns a knex promise containing an array of