Showing
2 changed files
with
10 additions
and
1 deletions
... | @@ -4,7 +4,14 @@ import bcrypt from "bcryptjs"; | ... | @@ -4,7 +4,14 @@ 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 = "" } = args; | 7 | + const { |
8 | + name, | ||
9 | + password, | ||
10 | + email, | ||
11 | + bio = "", | ||
12 | + avatarUrl = "", | ||
13 | + phoneNumber = "", | ||
14 | + } = args; | ||
8 | const encryptPw = await bcrypt.hash(password, 10); | 15 | const encryptPw = await bcrypt.hash(password, 10); |
9 | const user = await prisma.user.create({ | 16 | const user = await prisma.user.create({ |
10 | data: { | 17 | data: { |
... | @@ -13,6 +20,7 @@ export default { | ... | @@ -13,6 +20,7 @@ export default { |
13 | bio, | 20 | bio, |
14 | avatarUrl, | 21 | avatarUrl, |
15 | password: encryptPw, | 22 | password: encryptPw, |
23 | + phoneNumber, | ||
16 | }, | 24 | }, |
17 | }); | 25 | }); |
18 | const token = generateToken(user.id); | 26 | const token = generateToken(user.id); | ... | ... |
-
Please register or login to post a comment