Created
June 5, 2021 01:35
-
-
Save mosufy/2dbdaaa43bf4c74ec0e998eefb0c65ff to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { validateParameters } from './utils'; | |
import { checkUsernameExists, checkEmailExists } from './users'; | |
import { insertUser } from './users/db'; | |
export const createNewAccount = async (params) => { | |
await validateParameters(params); | |
await checkUsernameExists(params.username); | |
await checkEmailExists(params.email); | |
return insertUser(params); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment