Last active
December 25, 2019 23:45
-
-
Save KwabenBerko/3f1bc5a65d46624ab6dc8b73665f8696 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as UserService from "./user.service"; | |
export const register = async (email: string, password: string): Promise<User> =>{ | |
const user = await UserService.findByEmail(email); | |
if(user){ | |
throw new Error("An account with this email already exists.") | |
} | |
//Continue Logic | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const findByEmail = async (email: string): Promise<User> => { | |
// Some Logic | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment