adding all logic for sending request and should work?
This commit is contained in:
@@ -65,6 +65,8 @@ async function getUserDetails(req: Request, res: Response) {
|
||||
// create user if not exists
|
||||
const insertResult = await UserService.createUserIfNotExists(newUser);
|
||||
|
||||
newUser._id = insertResult?.insertedId;
|
||||
|
||||
insertResult
|
||||
? res.status(200).send(newUser)
|
||||
: res.status(500).send("Failed to create account, already exists");
|
||||
|
||||
Reference in New Issue
Block a user