b2bf1aaf92
I moved /auth/account/privilege to /admin/privilege I also fixed PATCH and DELETE on /account
20 lines
377 B
JavaScript
20 lines
377 B
JavaScript
const { accounts } = require('../database/models');
|
|
|
|
//auth/account/privilege
|
|
const route = async (req, res) => {
|
|
const updated = await accounts.update({
|
|
privilege: req.body.privilege
|
|
}, {
|
|
where: {
|
|
username: req.body.username
|
|
}
|
|
});
|
|
|
|
if (updated < 1) {
|
|
return res.status(403).send(`Unknown account`);
|
|
}
|
|
|
|
return res.status(200).end();
|
|
};
|
|
|
|
module.exports = route; |