mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
feat: update ticket color on frontend after assign
This commit is contained in:
@@ -27,7 +27,7 @@ const CreateMessageService = async ({
|
||||
{
|
||||
model: Ticket,
|
||||
as: "ticket",
|
||||
include: ["contact"]
|
||||
include: ["contact", "queue"]
|
||||
},
|
||||
{
|
||||
model: Message,
|
||||
|
||||
@@ -145,12 +145,12 @@ const verifyQueue = async (
|
||||
|
||||
const selectedOption = msg.body[0];
|
||||
|
||||
const validOption = queues[+selectedOption - 1];
|
||||
const choosenQueue = queues[+selectedOption - 1];
|
||||
|
||||
if (validOption) {
|
||||
await ticket.$set("queue", validOption);
|
||||
if (choosenQueue) {
|
||||
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);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as Yup from "yup";
|
||||
|
||||
import AppError from "../../errors/AppError";
|
||||
import Whatsapp from "../../models/Whatsapp";
|
||||
import AssociateWhatsappQueue from "../QueueService/AssociateWhatsappQueue";
|
||||
import AssociateWhatsappQueue from "./AssociateWhatsappQueue";
|
||||
|
||||
interface Request {
|
||||
name: string;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Op } from "sequelize";
|
||||
import AppError from "../../errors/AppError";
|
||||
import Whatsapp from "../../models/Whatsapp";
|
||||
import ShowWhatsAppService from "./ShowWhatsAppService";
|
||||
import AssociateWhatsappQueue from "../QueueService/AssociateWhatsappQueue";
|
||||
import AssociateWhatsappQueue from "./AssociateWhatsappQueue";
|
||||
|
||||
interface WhatsappData {
|
||||
name?: string;
|
||||
|
||||
Reference in New Issue
Block a user