Showing
2 changed files
with
2 additions
and
10 deletions
| 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); | ... | ... |
-
Please register or login to post a comment