Merge branch 'test' into feature/qbo

This commit is contained in:
Patrick Fic
2021-09-23 11:48:56 -07:00
45 changed files with 1356 additions and 707 deletions

View File

@@ -12,14 +12,24 @@ query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID(
}
`;
exports.INSERT_MESSAGE = `
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid) {
update_conversations(where: {id: {_eq: $conversationid}}, _set: {archived: false}) {
affected_rows
exports.UNARCHIVE_CONVERSATION = `
mutation UNARCHIVE_CONVERSATION($id: uuid!) {
update_conversations_by_pk(pk_columns: {id: $id}, _set: {archived: false}) {
id
}
insert_messages(objects: $msg) {
}
`;
exports.INSERT_MESSAGE = `
mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) {
update_conversations_by_pk(pk_columns: {id: $conversationid}, _set: {archived: false}) {
id
}
insert_messages(objects: $msg) {
returning {
conversation {
id
archived
bodyshop {
associations(where: {active: {_eq: true}}) {
user {

View File

@@ -55,7 +55,7 @@ exports.send = (req, res) => {
: [],
};
gqlClient
.request(queries.INSERT_MESSAGE, { msg: newMessage })
.request(queries.INSERT_MESSAGE, { msg: newMessage, conversationid })
.then((r2) => {
//console.log("Responding GQL Message ID", JSON.stringify(r2));
logger.log("sms-outbound-success", "DEBUG", req.user.email, null, {