feat: update ticket color on frontend after assign

This commit is contained in:
canove
2021-01-11 18:23:28 -03:00
parent 14c3ebe27e
commit 5c5f58e4fe
5 changed files with 7 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ const CreateMessageService = async ({
{ {
model: Ticket, model: Ticket,
as: "ticket", as: "ticket",
include: ["contact"] include: ["contact", "queue"]
}, },
{ {
model: Message, model: Message,

View File

@@ -145,12 +145,12 @@ const verifyQueue = async (
const selectedOption = msg.body[0]; const selectedOption = msg.body[0];
const validOption = queues[+selectedOption - 1]; const choosenQueue = queues[+selectedOption - 1];
if (validOption) { if (choosenQueue) {
await ticket.$set("queue", validOption); await ticket.$set("queue", choosenQueue);
const body = `\u200e ${validOption.greetingMessage}`; const body = `\u200e ${choosenQueue.greetingMessage}`;
const sentMessage = await wbot.sendMessage(`${contact.number}@c.us`, body); const sentMessage = await wbot.sendMessage(`${contact.number}@c.us`, body);

View File

@@ -2,7 +2,7 @@ import * as Yup from "yup";
import AppError from "../../errors/AppError"; import AppError from "../../errors/AppError";
import Whatsapp from "../../models/Whatsapp"; import Whatsapp from "../../models/Whatsapp";
import AssociateWhatsappQueue from "../QueueService/AssociateWhatsappQueue"; import AssociateWhatsappQueue from "./AssociateWhatsappQueue";
interface Request { interface Request {
name: string; name: string;

View File

@@ -4,7 +4,7 @@ import { Op } from "sequelize";
import AppError from "../../errors/AppError"; import AppError from "../../errors/AppError";
import Whatsapp from "../../models/Whatsapp"; import Whatsapp from "../../models/Whatsapp";
import ShowWhatsAppService from "./ShowWhatsAppService"; import ShowWhatsAppService from "./ShowWhatsAppService";
import AssociateWhatsappQueue from "../QueueService/AssociateWhatsappQueue"; import AssociateWhatsappQueue from "./AssociateWhatsappQueue";
interface WhatsappData { interface WhatsappData {
name?: string; name?: string;