fix: save contact by remote whatsapp session
parent
e020a5f75d
commit
279c4697dd
|
@ -25,7 +25,7 @@ const GetDefaultWhatsApp = async ({
|
||||||
where: { isDefault: true }
|
where: { isDefault: true }
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!defaultWhatsapp && !ignoreNoWhatsappFound) {
|
if (!defaultWhatsapp) {
|
||||||
if (userId) {
|
if (userId) {
|
||||||
let whatsapps = await wbotByUserQueue({ userId, queueId });
|
let whatsapps = await wbotByUserQueue({ userId, queueId });
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,9 @@ const CheckIsValidContact = async (
|
||||||
let _status: any;
|
let _status: any;
|
||||||
|
|
||||||
if (!isValidNumber) {
|
if (!isValidNumber) {
|
||||||
|
|
||||||
|
console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkk ')
|
||||||
|
|
||||||
const { data, status } = await axios.post(
|
const { data, status } = await axios.post(
|
||||||
`${process.env.WHATS_NUMBER_VALIDATOR_URL}/api/validate`,
|
`${process.env.WHATS_NUMBER_VALIDATOR_URL}/api/validate`,
|
||||||
{ mobile: number },
|
{ mobile: number },
|
||||||
|
@ -45,6 +48,8 @@ const CheckIsValidContact = async (
|
||||||
}
|
}
|
||||||
if (ignoreThrow) return isValidNumber?.number;
|
if (ignoreThrow) return isValidNumber?.number;
|
||||||
|
|
||||||
|
console.log('_status: ', _status)
|
||||||
|
|
||||||
if (_status && _status == 422) throw new AppError("ERR_NO_WAPP_FOUND");
|
if (_status && _status == 422) throw new AppError("ERR_NO_WAPP_FOUND");
|
||||||
|
|
||||||
if (!isValidNumber || (isValidNumber && !isValidNumber.isValid)) {
|
if (!isValidNumber || (isValidNumber && !isValidNumber.isValid)) {
|
||||||
|
|
Loading…
Reference in New Issue