mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-01 21:30:30 +01:00
fix: permanent redirect on user api redirect shorthand
This commit is contained in:
@@ -22,7 +22,7 @@ Users.redirectBySlug = async (req, res) => {
|
||||
|
||||
if (uid) {
|
||||
const path = req.path.split('/').slice(3).join('/');
|
||||
helpers.redirect(res, `/api/v3/users/${uid}/${path}`, false);
|
||||
helpers.redirect(res, `/api/v3/users/${uid}/${path}`, true);
|
||||
} else {
|
||||
helpers.formatApiResponse(404, res);
|
||||
}
|
||||
@@ -34,6 +34,10 @@ Users.create = async (req, res) => {
|
||||
helpers.formatApiResponse(200, res, userObj);
|
||||
};
|
||||
|
||||
Users.exists = async (req, res) => {
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Users.update = async (req, res) => {
|
||||
const userObj = await api.users.update(req, { ...req.body, uid: req.params.uid });
|
||||
helpers.formatApiResponse(200, res, userObj);
|
||||
|
||||
Reference in New Issue
Block a user