sdy

update createAccount

...@@ -5,6 +5,5 @@ type Mutation { ...@@ -5,6 +5,5 @@ type Mutation {
5 password: String! 5 password: String!
6 bio: String 6 bio: String
7 avatarUrl: String 7 avatarUrl: String
8 - phoneNumber: String
9 ): AuthPayload! 8 ): AuthPayload!
10 } 9 }
......
...@@ -4,14 +4,7 @@ import bcrypt from "bcryptjs"; ...@@ -4,14 +4,7 @@ import bcrypt from "bcryptjs";
4 export default { 4 export default {
5 Mutation: { 5 Mutation: {
6 createAccount: async (_, args) => { 6 createAccount: async (_, args) => {
7 - const { 7 + const { name, password, email, bio, avatarUrl, phoneNumber } = args;
8 - name,
9 - password,
10 - email,
11 - bio = "",
12 - avatarUrl = "",
13 - phoneNumber = "",
14 - } = args;
15 const encryptPw = await bcrypt.hash(password, 10); 8 const encryptPw = await bcrypt.hash(password, 10);
16 const user = await prisma.user.create({ 9 const user = await prisma.user.create({
17 data: { 10 data: {
......