MCPcopy Create free account
hub / github.com/RemoteState/nodejs-ecs / CreateUser

Method CreateUser

src/controller/usersController.ts:45–60  ·  view source on GitHub ↗
(req: Request, res: Response, next: NextFunction)

Source from the content-addressed store, hash-verified

43 }
44
45 public async CreateUser(req: Request, res: Response, next: NextFunction) {
46 try {
47 const userReq = req.body;
48 const user = new User();
49 user.firstName = userReq.firstName;
50 user.lastName = userReq.lastName;
51 user.email = userReq.email;
52 user.phone = userReq.phone;
53 user.password = Utils.HashPassword(userReq.password);
54 user.gender = userReq.gender;
55 await user.save();
56 res.sendStatus(200);
57 } catch (e) {
58 next(e);
59 }
60 }
61}

Callers

nothing calls this directly

Calls 1

HashPasswordMethod · 0.80

Tested by

no test coverage detected