mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
improvement: mark ticket messages as read when ticket status change
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import AppError from "../../errors/AppError";
|
||||
import SetTicketMessagesAsRead from "../../helpers/SetTicketMessagesAsRead";
|
||||
import Contact from "../../models/Contact";
|
||||
import Ticket from "../../models/Ticket";
|
||||
import User from "../../models/User";
|
||||
@@ -40,6 +41,8 @@ const UpdateTicketService = async ({
|
||||
throw new AppError("No ticket found with this ID.", 404);
|
||||
}
|
||||
|
||||
await SetTicketMessagesAsRead(ticket);
|
||||
|
||||
const oldStatus = ticket.status;
|
||||
|
||||
await ticket.update({
|
||||
|
||||
Reference in New Issue
Block a user