Skip to content

Commit

Permalink
[Release] Release 3.21.1
Browse files Browse the repository at this point in the history
Update privilege api
Update ban api
  • Loading branch information
ryanlee2014 committed Aug 26, 2020
1 parent 0de8ee4 commit 8e8c410
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "CUP-Online-Judge-BackEnd",
"author": "Ryan Lee <gxlhybh@gmail.com>",
"homepage": "https://github.com/ryanlee2014",
"version": "3.21.0",
"version": "3.21.1",
"engines": {
"node": ">=12.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/routes/admin/account/ban_manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {error, ok} = require("../../../module/constants/state");
const {trimProperty} = require("../../../module/util");
router.get("/", async (req, res) => {
try {
res.json(ok.okMaker(await BanModel.getAll()));
res.json(ok.okMaker(await BanModel.getAllByRequest(req)));
} catch (e) {
console.log(e);
res.json(error.database);
Expand Down
9 changes: 6 additions & 3 deletions src/routes/admin/account/privilege.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ const UpdatePool = require("../../../module/user/LazyPrivilegeUpdatePool");
const privilegeList = ["administrator", "source_browser", "contest_creator", "http_judge", "problem_editor", "contest_manager", "editor"];

async function privilegeListGetter() {
return await query(`select * from privilege where rightstr in
('${privilegeList.join("','")}')
order by user_id`);
return await query(`select superuser.*, users.nick
from (select user_id, rightstr, defunct
from privilege
where rightstr in
('${privilegeList.join("','")}')) superuser
inner join users on users.user_id = superuser.user_id`);
}

async function modifyHandler(req, res, sql) {
Expand Down

0 comments on commit 8e8c410

Please sign in to comment.