sdy

update createAccount

...@@ -5,5 +5,6 @@ type Mutation { ...@@ -5,5 +5,6 @@ type Mutation {
5 password: String! 5 password: String!
6 bio: String 6 bio: String
7 avatarUrl: String 7 avatarUrl: String
8 + phoneNum: String
8 ): AuthPayload! 9 ): AuthPayload!
9 } 10 }
......
...@@ -4,7 +4,7 @@ import bcrypt from "bcryptjs"; ...@@ -4,7 +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 { name, password, email, bio, avatarUrl, phoneNumber } = args; 7 + const { name, password, email, bio, avatarUrl, phoneNum } = args;
8 const encryptPw = await bcrypt.hash(password, 10); 8 const encryptPw = await bcrypt.hash(password, 10);
9 const user = await prisma.user.create({ 9 const user = await prisma.user.create({
10 data: { 10 data: {
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
13 bio, 13 bio,
14 avatarUrl, 14 avatarUrl,
15 password: encryptPw, 15 password: encryptPw,
16 - phoneNumber, 16 + phoneNum,
17 }, 17 },
18 }); 18 });
19 const token = generateToken(user.id); 19 const token = generateToken(user.id);
......