(input: UserInput)
| 3 | import UserModel, { UserDocument, UserInput } from "../models/user.model"; |
| 4 | |
| 5 | export 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 | |
| 15 | export async function validatePassword({ |
| 16 | email, |