mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
change delete ticket route to typescript
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import AppError from "../../errors/AppError";
|
||||
import Contact from "../../models/Contact";
|
||||
import Ticket from "../../models/Ticket";
|
||||
|
||||
interface TicketData {
|
||||
@@ -18,7 +19,14 @@ const UpdateTicketService = async ({
|
||||
const { status, userId } = ticketData;
|
||||
|
||||
const ticket = await Ticket.findOne({
|
||||
where: { id: ticketId }
|
||||
where: { id: ticketId },
|
||||
include: [
|
||||
{
|
||||
model: Contact,
|
||||
as: "contact",
|
||||
attributes: ["name", "number", "profilePicUrl"]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
if (!ticket) {
|
||||
|
||||
Reference in New Issue
Block a user