C
C#3y ago
Alparslan~

I need help for register

I can get username and password but "userCreate" return null. what is wrong ?
7 Replies
Instinct
Instinct3y ago
Is it null because you've put the return before setting it?
Alparslan~
Alparslan~OP3y ago
which return ? i wrote like in the video.
Instinct
Instinct3y ago
return Ok();
Alparslan~
Alparslan~OP3y ago
I put it at the end and register was added to the data. should I remove the status code? Thanks for help
dancepanda42
dancepanda423y ago
I think the return Ok(); should be in the line 36. To return the statuscode 200 if the user already exists.
if (await authRepository.UserExists(userForRegisterDto.UserName))
{
....otherCode
return Ok();
}
if (await authRepository.UserExists(userForRegisterDto.UserName))
{
....otherCode
return Ok();
}
Alparslan~
Alparslan~OP3y ago
I did it this way and i remove status code. now i can add user
dancepanda42
dancepanda423y ago
this is also ok 👍
Want results from more Discord servers?
Add your server