sdy

remove unnecessary fields

...@@ -3,8 +3,5 @@ type Mutation { ...@@ -3,8 +3,5 @@ type Mutation {
3 username: String! 3 username: String!
4 email: String! 4 email: String!
5 password: String! 5 password: String!
6 - phoneNum: String!
7 - bio: String
8 - avatarUrl: String
9 ): AuthPayload! 6 ): AuthPayload!
10 } 7 }
......
1 -import { prisma, generateToken, changePhoneNumber } from "../../../utils"; 1 +import { prisma, generateToken } from "../../../utils";
2 import bcrypt from "bcryptjs"; 2 import bcrypt from "bcryptjs";
3 3
4 export default { 4 export default {
5 Mutation: { 5 Mutation: {
6 createAccount: async (_, args) => { 6 createAccount: async (_, args) => {
7 - const { username, password, email, phoneNum, bio, avatarUrl } = args; 7 + const { username, password, email } = args;
8 8
9 const encryptPw = await bcrypt.hash(password, 10); 9 const encryptPw = await bcrypt.hash(password, 10);
10 - // TODO: Find user's country code and change new phone number value
11 - const newPhoneNumber = await changePhoneNumber(phoneNum, "+82");
12 const user = await prisma.user.create({ 10 const user = await prisma.user.create({
13 data: { 11 data: {
14 username, 12 username,
15 email, 13 email,
16 password: encryptPw, 14 password: encryptPw,
17 - phoneNum: newPhoneNumber,
18 - bio,
19 - avatarUrl,
20 }, 15 },
21 }); 16 });
22 const token = generateToken(user.id); 17 const token = generateToken(user.id);
......