diff --git a/models/problem.js b/models/problem.js index 5f9eeb7..63a0795 100644 --- a/models/problem.js +++ b/models/problem.js @@ -388,7 +388,7 @@ class Problem extends Model { }); res.sort((a, b) => { - return a.name > b.name ? 1 : -1; + return a.color > b.color ? 1 : -1; }); return res; diff --git a/views/problems.ejs b/views/problems.ejs index a78ab3d..711cec4 100644 --- a/views/problems.ejs +++ b/views/problems.ejs @@ -12,7 +12,7 @@ if (typeof tags !== 'undefined') tagIDs = tags.map(x => x.id); <% if (typeof tags !== 'undefined') { %> <% tags.sort((a, b) => { - return a.name > b.name ? 1 : -1; + return a.color > b.color ? 1 : -1; }); %> <% for (let tag of tags) { %>