feat: add signup logic

This commit is contained in:
Rıdvan Akca
2023-03-03 14:04:23 +03:00
parent c1150d50b1
commit 18089a8076
2 changed files with 5 additions and 1 deletions

View File

@@ -4,11 +4,12 @@ type Params = {
input: {
email: string;
password: string;
fullName: string;
};
};
const createUser = async (_parent: unknown, params: Params) => {
const { email, password } = params.input;
const { email, password, fullName } = params.input;
const existingUser = await User.query().findOne({ email });
@@ -19,6 +20,7 @@ const createUser = async (_parent: unknown, params: Params) => {
const user = await User.query().insert({
email,
password,
fullName,
role: 'user',
});