Resolve more Phone Lib issues.
This commit is contained in:
@@ -26,7 +26,7 @@ exports.receive = (req, res) => {
|
||||
client
|
||||
.request(queries.FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID, {
|
||||
mssid: req.body.MessagingServiceSid,
|
||||
phone: phone(req.body.From)[0],
|
||||
phone: phone(req.body.From).phoneNumber,
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("re", req.body);
|
||||
@@ -45,7 +45,7 @@ exports.receive = (req, res) => {
|
||||
newMessage.conversation = {
|
||||
data: {
|
||||
bodyshopid: response.bodyshops[0].id,
|
||||
phone_num: phone(req.body.From)[0],
|
||||
phone_num: phone(req.body.From).phoneNumber,
|
||||
},
|
||||
};
|
||||
} else if (response.bodyshops[0].conversations.length === 1) {
|
||||
@@ -80,13 +80,13 @@ exports.receive = (req, res) => {
|
||||
const uniqueTokens = [...new Set(allTokens)];
|
||||
var message = {
|
||||
notification: {
|
||||
title: `SMS - ${phone(req.body.From)[0]}`,
|
||||
title: `SMS - ${phone(req.body.From).phoneNumber}`,
|
||||
body: req.body.Body,
|
||||
click_action: "TEST CLICK ACTION",
|
||||
},
|
||||
data: {
|
||||
jobid: "1234",
|
||||
title: `New SMS From ${phone(req.body.From)[0]}`,
|
||||
title: `New SMS From ${phone(req.body.From).phoneNumber}`,
|
||||
body: req.body.Body,
|
||||
},
|
||||
tokens: uniqueTokens,
|
||||
|
||||
@@ -30,7 +30,7 @@ exports.send = (req, res) => {
|
||||
.create({
|
||||
body: body,
|
||||
messagingServiceSid: messagingServiceSid,
|
||||
to: phone(to)[0],
|
||||
to: phone(to).phoneNumber,
|
||||
mediaUrl: selectedMedia.map((i) => i.src),
|
||||
})
|
||||
.then((message) => {
|
||||
|
||||
Reference in New Issue
Block a user