Skip to content

Commit

Permalink
[TTAHUB-35]: Remove manual ordering, order by report id.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcloud committed Mar 25, 2021
1 parent 222fa88 commit 81e2050
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/services/activityReports.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,16 +687,8 @@ export async function getDownloadableActivityReports(readRegions, {
},
],
distinct: true,
order: [['id', 'DESC']],
},
);
// Hack together manual sort until we can figure out how to do custom SQL
const sortedRows = [];
reportIds.forEach((id) => {
const match = result.rows.find((el) => el.id.toString() === id);
if (match) {
sortedRows.push(match);
}
});
result.rows = sortedRows;
return result;
}

0 comments on commit 81e2050

Please sign in to comment.