Compare commits
No commits in common. "279c4697ddcf97a0f382f0fe5d1c82cec4dbffb9" and "ec6e84f56739d7d424f933258d27eafe69f0e782" have entirely different histories.
279c4697dd
...
ec6e84f567
|
@ -93,7 +93,7 @@ export const index = async (req: Request, res: Response): Promise<Response> => {
|
|||
|
||||
let queueIds: number[] = [];
|
||||
|
||||
if (queueIdsStringified && queueIdsStringified.trim().length > 0) {
|
||||
if (queueIdsStringified) {
|
||||
queueIds = JSON.parse(queueIdsStringified);
|
||||
}
|
||||
|
||||
|
|
|
@ -265,10 +265,6 @@ export const weebhook = async (
|
|||
});
|
||||
|
||||
if (type == "text") {
|
||||
if (!message?.text?.body) {
|
||||
return res.status(400).json({ error: "body not found" });
|
||||
}
|
||||
|
||||
type = "chat";
|
||||
msg = {
|
||||
...msg,
|
||||
|
@ -276,10 +272,6 @@ export const weebhook = async (
|
|||
type
|
||||
};
|
||||
} else {
|
||||
if (!message[message?.type]?.id) {
|
||||
return res.status(400).json({ error: "id not found" });
|
||||
}
|
||||
|
||||
const mediaId = message[message.type].id;
|
||||
const mimetype = message[message.type].mime_type;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ const GetDefaultWhatsApp = async ({
|
|||
where: { isDefault: true }
|
||||
});
|
||||
|
||||
if (!defaultWhatsapp) {
|
||||
if (!defaultWhatsapp && !ignoreNoWhatsappFound) {
|
||||
if (userId) {
|
||||
let whatsapps = await wbotByUserQueue({ userId, queueId });
|
||||
|
||||
|
|
|
@ -27,13 +27,9 @@ const CheckIsValidContact = async (
|
|||
}
|
||||
|
||||
try {
|
||||
let _status: any;
|
||||
|
||||
if (!isValidNumber) {
|
||||
|
||||
console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkk ')
|
||||
|
||||
const { data, status } = await axios.post(
|
||||
const { data } = await axios.post(
|
||||
`${process.env.WHATS_NUMBER_VALIDATOR_URL}/api/validate`,
|
||||
{ mobile: number },
|
||||
{
|
||||
|
@ -44,14 +40,10 @@ const CheckIsValidContact = async (
|
|||
);
|
||||
|
||||
isValidNumber = data;
|
||||
_status = status;
|
||||
}
|
||||
|
||||
if (ignoreThrow) return isValidNumber?.number;
|
||||
|
||||
console.log('_status: ', _status)
|
||||
|
||||
if (_status && _status == 422) throw new AppError("ERR_NO_WAPP_FOUND");
|
||||
|
||||
if (!isValidNumber || (isValidNumber && !isValidNumber.isValid)) {
|
||||
throw new AppError("invalidNumber");
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ import FindOrCreateTicketServiceBot from "../TicketServices/FindOrCreateTicketSe
|
|||
import ShowTicketService from "../TicketServices/ShowTicketService";
|
||||
import ShowQueuesByUser from "../UserServices/ShowQueuesByUser";
|
||||
import ListWhatsappQueuesByUserQueue from "../UserServices/ListWhatsappQueuesByUserQueue";
|
||||
import CreateContactService from "../ContactServices/CreateContactService";
|
||||
import CreateContactService from "../ContactServices/CreateContactService"
|
||||
|
||||
var lst: any[] = getWhatsappIds();
|
||||
|
||||
|
@ -318,15 +318,14 @@ const verifyQueue = async (
|
|||
selectedOption = 1;
|
||||
choosenQueue = queues[+selectedOption - 1];
|
||||
} else {
|
||||
selectedOption = msg?.body;
|
||||
selectedOption = msg.body;
|
||||
|
||||
if (selectedOption && selectedOption.trim().length > 0) {
|
||||
//////////////// EXTRAIR APENAS O NÚMERO ///////////////////
|
||||
selectedOption = selectedOption.replace(/[^1-9]/g, "");
|
||||
///////////////////////////////////
|
||||
|
||||
choosenQueue = queues[+selectedOption - 1];
|
||||
}
|
||||
}
|
||||
|
||||
if (choosenQueue) {
|
||||
// Atualizando o status do ticket para mostrar notificação para o atendente da fila escolhida pelo usuário. De queueChoice para pending
|
||||
|
|
|
@ -126,10 +126,10 @@ const ContactModal = ({ open, onClose, contactId, initialValues, onSave }) => {
|
|||
handleClose()
|
||||
}
|
||||
toast.success(i18n.t("contactModal.success"))
|
||||
setSaving(false)
|
||||
} catch (err) {
|
||||
toastError(err)
|
||||
}
|
||||
setSaving(false)
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue