mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-20 12:49:32 +00:00
feat: update ticket color on frontend after assign
This commit is contained in:
@@ -27,7 +27,7 @@ const CreateMessageService = async ({
|
|||||||
{
|
{
|
||||||
model: Ticket,
|
model: Ticket,
|
||||||
as: "ticket",
|
as: "ticket",
|
||||||
include: ["contact"]
|
include: ["contact", "queue"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
model: Message,
|
model: Message,
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user