Showing
1 changed file
with
5 additions
and
3 deletions
... | @@ -9,13 +9,15 @@ export default { | ... | @@ -9,13 +9,15 @@ export default { |
9 | password, | 9 | password, |
10 | password2, | 10 | password2, |
11 | email, | 11 | email, |
12 | + phoneNum, | ||
12 | bio, | 13 | bio, |
13 | avatarUrl, | 14 | avatarUrl, |
14 | - phoneNum, | ||
15 | } = args; | 15 | } = args; |
16 | + | ||
16 | if (password !== password2) { | 17 | if (password !== password2) { |
17 | throw new Error("two password aren't same each other"); | 18 | throw new Error("two password aren't same each other"); |
18 | } | 19 | } |
20 | + | ||
19 | const encryptPw = await bcrypt.hash(password, 10); | 21 | const encryptPw = await bcrypt.hash(password, 10); |
20 | // TODO: Find user's country code and change new phone number value | 22 | // TODO: Find user's country code and change new phone number value |
21 | const newPhoneNumber = await changePhoneNumber(phoneNum, "+82"); | 23 | const newPhoneNumber = await changePhoneNumber(phoneNum, "+82"); |
... | @@ -23,10 +25,10 @@ export default { | ... | @@ -23,10 +25,10 @@ export default { |
23 | data: { | 25 | data: { |
24 | username, | 26 | username, |
25 | email, | 27 | email, |
26 | - bio, | ||
27 | - avatarUrl, | ||
28 | password: encryptPw, | 28 | password: encryptPw, |
29 | phoneNum: newPhoneNumber, | 29 | phoneNum: newPhoneNumber, |
30 | + bio, | ||
31 | + avatarUrl, | ||
30 | }, | 32 | }, |
31 | }); | 33 | }); |
32 | const token = generateToken(user.id); | 34 | const token = generateToken(user.id); | ... | ... |
-
Please register or login to post a comment