Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return should be provided in register user controller #185

Open
Madhav8528 opened this issue Jan 5, 2025 · 1 comment
Open

return should be provided in register user controller #185

Madhav8528 opened this issue Jan 5, 2025 · 1 comment

Comments

@Madhav8528
Copy link

In, register user controller we are checking for empty fields by taking values from req.body by using some() function but we did'nt use return inside the arrow function of some() method so it will always result false, we have to add a return in the arrow function to properly use some() method.

Before :
if(
[username, email, fullName, password].some((field)=>{ field?.trim()===""})
){
throw new ApiError(400, "Please provide all the details")
}

After :
if(
[username, email, fullName, password].some((field)=>{ return field?.trim()===""})
){
throw new ApiError(400, "Please provide all the details")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@prabhsingh14 @Madhav8528 and others