|
|
|
@ -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);
|
|
|
|
|