create-nodeapi-backend
Version:
A powerful Node.js backend boilerplate with Express, MongoDB, Firebase, JWT auth, Nodemailer, cron jobs, input validation (Joi), and serverless support for Vercel. Scaffold a full-featured API backend in seconds.
23 lines (19 loc) • 601 B
JavaScript
const updateUserById = require("../../service/User/updateUser");
const updateUserController = catchAsync(async (req, res) => {
const userId = await getId(req, res);
const { profileInfo, address, avatar } = req.body;
try {
const { code, message, data } = await updateUserById({
userId,
profileInfo,
address,
avatar
});
handleResponse(res, code, message, data);
} catch (error) {
res.status(statusCodeMap[500]).send({
message: "Internal Server Error, Contact Dev team"
});
}
});
module.exports = updateUserController;