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

Function createUser

src/service/user.service.ts:5–11  ·  view source on GitHub ↗
(input: DocumentDefinition<UserDocument>)

Source from the content-addressed store, hash-verified

3import User, { UserDocument } from "../model/user.model";
4
5export async function createUser(input: DocumentDefinition<UserDocument>) {
6 try {
7 return await User.create(input);
8 } catch (error) {
9 throw new Error(error);
10 }
11}
12
13export async function findUser(query: FilterQuery<UserDocument>) {
14 return User.findOne(query).lean();

Callers 1

createUserHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected