feat: add signup logic
This commit is contained in:
@@ -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',
|
||||
});
|
||||
|
||||
|
@@ -335,6 +335,7 @@ input DeleteStepInput {
|
||||
}
|
||||
|
||||
input CreateUserInput {
|
||||
fullName: String!
|
||||
email: String!
|
||||
password: String!
|
||||
}
|
||||
@@ -428,6 +429,7 @@ input StepInput {
|
||||
type User {
|
||||
id: String
|
||||
fullName: String
|
||||
password: String
|
||||
email: String
|
||||
role: String
|
||||
createdAt: String
|
||||
|
Reference in New Issue
Block a user