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 19:13:51 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2e4489a76c1161cc42bb3f2d96b1ece12db611a9
2e4489a7
1 parent
c509fd47
update findEmail
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
back/src/api/User/findEmail/findEmail.js
back/src/api/User/findEmail/findEmail.js
View file @
2e4489a
import
{
prisma
,
isAuthenticated
}
from
"../../../utils"
;
import
{
prisma
,
isAuthenticated
,
changePhoneNumber
}
from
"../../../utils"
;
import
twilio
from
"twilio"
;
export
default
{
Query
:
{
findEmail
:
async
(
_
,
args
)
=>
{
const
{
phoneNum
}
=
args
;
const
changeNum
=
await
changePhoneNumber
(
phoneNum
,
"+82"
);
const
user
=
await
prisma
.
user
.
findOne
({
where
:
{
phoneNum
,
phoneNum
:
changeNum
,
},
});
if
(
user
&&
isAuthenticated
)
{
...
...
@@ -18,7 +19,7 @@ export default {
client
.
messages
.
create
({
body
:
`Your Email is :
${
user
.
email
}
`
,
to
:
`
${
phon
eNum
}
`
,
to
:
`
${
chang
eNum
}
`
,
from
:
`
${
twilioPhone
}
`
,
})
.
then
((
message
)
=>
{
...
...
Please
register
or
login
to post a comment