Browse Source

Allow sort by publicize time

pull/6/head
hewenyang 7 years ago
parent
commit
2dee15a357
  1. 2
      modules/problem.js

2
modules/problem.js

@ -35,7 +35,7 @@ app.get('/problems', async (req, res) => {
try {
const sort = req.query.sort || syzoj.config.sorting.problem.field;
const order = req.query.order || syzoj.config.sorting.problem.order;
if (!['id', 'title', 'rating', 'ac_num', 'submit_num', 'ac_rate'].includes(sort) || !['asc', 'desc'].includes(order)) {
if (!['id', 'title', 'rating', 'ac_num', 'submit_num', 'ac_rate', 'publicize_time'].includes(sort) || !['asc', 'desc'].includes(order)) {
throw new ErrorMessage('错误的排序参数。');
}

Loading…
Cancel
Save