Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-04-26 00:41:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e3ea32143b2811880d8d51188e2a94af0c592b8b
e3ea3214
1 parent
a2ea1364
update createAccount
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
back/src/api/User/createAccount/createAccount.graphql
back/src/api/User/createAccount/createAccount.js
back/src/api/User/createAccount/createAccount.graphql
View file @
e3ea321
...
...
@@ -5,5 +5,6 @@ type Mutation {
password: String!
bio: String
avatarUrl: String
phoneNum: String
): AuthPayload!
}
...
...
back/src/api/User/createAccount/createAccount.js
View file @
e3ea321
...
...
@@ -4,7 +4,7 @@ import bcrypt from "bcryptjs";
export
default
{
Mutation
:
{
createAccount
:
async
(
_
,
args
)
=>
{
const
{
name
,
password
,
email
,
bio
,
avatarUrl
,
phoneNum
ber
}
=
args
;
const
{
name
,
password
,
email
,
bio
,
avatarUrl
,
phoneNum
}
=
args
;
const
encryptPw
=
await
bcrypt
.
hash
(
password
,
10
);
const
user
=
await
prisma
.
user
.
create
({
data
:
{
...
...
@@ -13,7 +13,7 @@ export default {
bio
,
avatarUrl
,
password
:
encryptPw
,
phoneNum
ber
,
phoneNum
,
},
});
const
token
=
generateToken
(
user
.
id
);
...
...
Please
register
or
login
to post a comment