Skip to content

Commit

Permalink
Fix ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
undeadjess committed Oct 22, 2024
1 parent 67c564e commit 98ac4a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ function getServerURL(server, version, build) {
`;
// get just of all versions to display after latest - dont need to sort by build
queryGetAllVersions = `
SELECT DISTINCT version FROM ${server} ORDER BY
CAST(SUBSTRING_INDEX(version, '.', 1) AS UNSIGNED) DESC,
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', 2), '.', -1) AS UNSIGNED) DESC,
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', -1), '.', -1) AS UNSIGNED) DESC
SELECT DISTINCT version FROM ${server}
ORDER BY
CAST(SUBSTRING_INDEX(version, '.', 1) AS UNSIGNED) DESC,
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', 2), '.', -1) AS UNSIGNED) DESC,
CAST(COALESCE(SUBSTRING_INDEX(SUBSTRING_INDEX(version, '.', -1), '.', -1), '0') AS UNSIGNED) DESC
`;
params = [];
}
Expand Down

0 comments on commit 98ac4a0

Please sign in to comment.