Skip to content

Instantly share code, notes, and snippets.

@mosufy
Created June 5, 2021 01:35
Show Gist options
  • Save mosufy/2dbdaaa43bf4c74ec0e998eefb0c65ff to your computer and use it in GitHub Desktop.
Save mosufy/2dbdaaa43bf4c74ec0e998eefb0c65ff to your computer and use it in GitHub Desktop.
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