sdy

update findEmail

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: `${phoneNum}`,
to: `${changeNum}`,
from: `${twilioPhone}`,
})
.then((message) => {
......