BOD-14 WIP. CSS issues present with 2 way texting, but working live.
This commit is contained in:
@@ -10,15 +10,8 @@ const client = twilio(
|
||||
const gqlClient = require("../graphql-client/graphql-client").client;
|
||||
|
||||
exports.send = (req, res) => {
|
||||
console.log("Sending an SMS!");
|
||||
const { to, messagingServiceSid, body, conversationid } = req.body;
|
||||
console.log(
|
||||
"to, messagingServiceSid, body, conversationid",
|
||||
to,
|
||||
messagingServiceSid,
|
||||
body,
|
||||
conversationid
|
||||
);
|
||||
console.log("[Sending Sms] " + conversationid + " | " + body);
|
||||
if (!!to && !!messagingServiceSid && !!body && !!conversationid) {
|
||||
client.messages
|
||||
.create({
|
||||
@@ -36,6 +29,7 @@ exports.send = (req, res) => {
|
||||
gqlClient
|
||||
.request(queries.INSERT_MESSAGE, { msg: newMessage })
|
||||
.then(r2 => {
|
||||
console.log("Responding GQL Message ID", JSON.stringify(r2));
|
||||
res.sendStatus(200);
|
||||
})
|
||||
.catch(e2 => {
|
||||
@@ -48,6 +42,8 @@ exports.send = (req, res) => {
|
||||
console.log("e1", e1);
|
||||
});
|
||||
} else {
|
||||
res.json({ success: false, message: "Missing required parameter(s)." });
|
||||
res
|
||||
.status(400)
|
||||
.json({ success: false, message: "Missing required parameter(s)." });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user