MCPcopy Create free account
hub / github.com/TomDoesTech/REST-API-Tutorial-Updated / createUser

Function createUser

src/service/user.service.ts:5–13  ·  view source on GitHub ↗
(input: UserInput)

Source from the content-addressed store, hash-verified

3import UserModel, { UserDocument, UserInput } from "../models/user.model";
4
5export async function createUser(input: UserInput) {
6 try {
7 const user = await UserModel.create(input);
8
9 return omit(user.toJSON(), "password");
10 } catch (e: any) {
11 throw new Error(e);
12 }
13}
14
15export async function validatePassword({
16 email,

Callers 1

createUserHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected