Skip to content

Instantly share code, notes, and snippets.

@KwabenBerko
Last active December 25, 2019 23:45
Show Gist options
  • Save KwabenBerko/3f1bc5a65d46624ab6dc8b73665f8696 to your computer and use it in GitHub Desktop.
Save KwabenBerko/3f1bc5a65d46624ab6dc8b73665f8696 to your computer and use it in GitHub Desktop.
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
}
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