mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
fix: remove ticket from all users when deleted
This commit is contained in:
@@ -22,7 +22,7 @@ const CreateMessageService = async ({
|
||||
const ticket = await ShowTicketService(ticketId);
|
||||
|
||||
if (!ticket) {
|
||||
throw new AppError("No ticket found with this ID");
|
||||
throw new AppError("No ticket found with this ID", 404);
|
||||
}
|
||||
|
||||
const message: Message = await ticket.$create("message", messageData);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { where, fn, col } from "sequelize";
|
||||
import AppError from "../../errors/AppError";
|
||||
import Message from "../../models/Message";
|
||||
import Ticket from "../../models/Ticket";
|
||||
import ShowTicketService from "../TicketServices/ShowTicketService";
|
||||
@@ -24,7 +25,7 @@ const ListMessagesService = async ({
|
||||
const ticket = await ShowTicketService(ticketId);
|
||||
|
||||
if (!ticket) {
|
||||
throw new Error("No ticket found with this ID");
|
||||
throw new AppError("No ticket found with this ID", 404);
|
||||
}
|
||||
|
||||
const whereCondition = {
|
||||
|
||||
Reference in New Issue
Block a user