feat: add signup logic
This commit is contained in:
@@ -4,11 +4,12 @@ type Params = {
|
|||||||
input: {
|
input: {
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
fullName: string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const createUser = async (_parent: unknown, params: Params) => {
|
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 });
|
const existingUser = await User.query().findOne({ email });
|
||||||
|
|
||||||
@@ -19,6 +20,7 @@ const createUser = async (_parent: unknown, params: Params) => {
|
|||||||
const user = await User.query().insert({
|
const user = await User.query().insert({
|
||||||
email,
|
email,
|
||||||
password,
|
password,
|
||||||
|
fullName,
|
||||||
role: 'user',
|
role: 'user',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -335,6 +335,7 @@ input DeleteStepInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input CreateUserInput {
|
input CreateUserInput {
|
||||||
|
fullName: String!
|
||||||
email: String!
|
email: String!
|
||||||
password: String!
|
password: String!
|
||||||
}
|
}
|
||||||
@@ -428,6 +429,7 @@ input StepInput {
|
|||||||
type User {
|
type User {
|
||||||
id: String
|
id: String
|
||||||
fullName: String
|
fullName: String
|
||||||
|
password: String
|
||||||
email: String
|
email: String
|
||||||
role: String
|
role: String
|
||||||
createdAt: String
|
createdAt: String
|
||||||
|
Reference in New Issue
Block a user