This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const registerUser = asyncHandler(async (req, res) => { | |
// get user details from FE | |
// validation of user - not empty, email, password | |
// check if user exists or not - username, email | |
// hash password | |
// check for images and avatar | |
// upload to cloudinary | |
// create user object - create user entry in db | |
// remove password and refresh token from response | |
// check if respose of user creation is success or not |