Altered API, read more

I moved /auth/account/privilege to /admin/privilege

I also fixed PATCH and DELETE on /account
This commit is contained in:
2021-03-14 04:34:46 +11:00
parent 61ddd5b38f
commit b2bf1aaf92
8 changed files with 40 additions and 28 deletions
+21
View File
@@ -0,0 +1,21 @@
const { accounts } = require('../database/models');
//auth/account
const route = async (req, res) => {
const account = await accounts.findOne({
where: {
id: req.user.id
}
});
if (!account) {
return res.status(401).send('Unknown account');
}
//respond with the private-facing data
return res.status(200).json({
contact: account.contact
});
};
module.exports = route;