You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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")
}
The text was updated successfully, but these errors were encountered:
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")
}
The text was updated successfully, but these errors were encountered: