mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
Merge pull request #324 from w3nder/master
Update package.json and fix bug farewellMessage
This commit is contained in:
@@ -52,8 +52,6 @@
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/multer": "^1.4.4",
|
||||
"@types/node": "^14.11.8",
|
||||
"@types/socket.io": "^2.1.11",
|
||||
"@types/socket.io-redis": "^1.0.26",
|
||||
"@types/supertest": "^2.0.10",
|
||||
"@types/validator": "^13.1.0",
|
||||
"@types/yup": "^0.29.8",
|
||||
|
||||
@@ -13,6 +13,7 @@ interface WhatsappData {
|
||||
name: string;
|
||||
queueIds: number[];
|
||||
greetingMessage?: string;
|
||||
farewellMessage?: string;
|
||||
status?: string;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
@@ -29,6 +30,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
status,
|
||||
isDefault,
|
||||
greetingMessage,
|
||||
farewellMessage,
|
||||
queueIds
|
||||
}: WhatsappData = req.body;
|
||||
|
||||
@@ -37,6 +39,7 @@ export const store = async (req: Request, res: Response): Promise<Response> => {
|
||||
status,
|
||||
isDefault,
|
||||
greetingMessage,
|
||||
farewellMessage,
|
||||
queueIds
|
||||
});
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ const handleMessage = async (
|
||||
|
||||
const contact = await verifyContact(msgContact);
|
||||
|
||||
if(unreadMessages === 0 && whatsapp.farewellMessage === msg.body) return;
|
||||
if ( unreadMessages === 0 && whatsapp.farewellMessage && whatsapp.farewellMessage === msg.body) return;
|
||||
|
||||
const ticket = await FindOrCreateTicketService(
|
||||
contact,
|
||||
|
||||
Reference in New Issue
Block a user