Showing
2 changed files
with
1 additions
and
14 deletions
... | @@ -3,7 +3,6 @@ type Mutation { | ... | @@ -3,7 +3,6 @@ type Mutation { |
3 | username: String! | 3 | username: String! |
4 | email: String! | 4 | email: String! |
5 | password: String! | 5 | password: String! |
6 | - password2: String! | ||
7 | phoneNum: String! | 6 | phoneNum: String! |
8 | bio: String | 7 | bio: String |
9 | avatarUrl: String | 8 | avatarUrl: String | ... | ... |
... | @@ -4,19 +4,7 @@ import bcrypt from "bcryptjs"; | ... | @@ -4,19 +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 { | 7 | + const { username, password, email, phoneNum, bio, avatarUrl } = args; |
8 | - username, | ||
9 | - password, | ||
10 | - password2, | ||
11 | - email, | ||
12 | - phoneNum, | ||
13 | - bio, | ||
14 | - avatarUrl, | ||
15 | - } = args; | ||
16 | - | ||
17 | - if (password !== password2) { | ||
18 | - throw new Error("two password aren't same each other"); | ||
19 | - } | ||
20 | 8 | ||
21 | const encryptPw = await bcrypt.hash(password, 10); | 9 | const encryptPw = await bcrypt.hash(password, 10); |
22 | // TODO: Find user's country code and change new phone number value | 10 | // TODO: Find user's country code and change new phone number value | ... | ... |
-
Please register or login to post a comment