Skip to content
Snippets Groups Projects

Cherry-pick admin capabilities from SLS

Merged Ghost User requested to merge admin-cherry into main
5 files
+ 185
23
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -135,7 +135,48 @@ exports.updateUserVerification = async (req, res) => {
res.status(responseStatusCodes.InternalServerError).send({
message: err.message || "Error updating User"
});
<<<<<<< HEAD
});
=======
}
);
};
exports.updateUserTeam = async (req, res) => {
updateUser(req.body.user_id, {team:req.body.team}).then(data => {
if (data) {
res.send(data);
} else {
res.status(responseStatusCodes.NotFound).send({
message: "Cannot find User."
});
}
})
.catch(err => {
res.status(responseStatusCodes.InternalServerError).send({
message: err.message || "Error updating User"
});
}
);
};
exports.getAllEmailAddressesForEditors = async () => {
const condition = { get_emails_editor: { [Op.eq]: true } };
return User.findAll({
where: condition,
attributes: ["email"],
raw: true,
}).then(data => {
data = data.map((user) => user.email);
return data;
}
).catch(err => {
logger.error(err.message);
return null;
});
>>>>>>> daa8f84 (Admin-Tool v3)
};
function updateUser(user_id, user_data){
Loading