mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 04:09:26 +00:00
improvement: remove tickets logic from useTickets to improve notifications
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Ticket from "../../models/Ticket";
|
||||
import AppError from "../../errors/AppError";
|
||||
|
||||
const DeleteTicketService = async (id: string): Promise<void> => {
|
||||
const DeleteTicketService = async (id: string): Promise<Ticket> => {
|
||||
const ticket = await Ticket.findOne({
|
||||
where: { id }
|
||||
});
|
||||
@@ -11,6 +11,8 @@ const DeleteTicketService = async (id: string): Promise<void> => {
|
||||
}
|
||||
|
||||
await ticket.destroy();
|
||||
|
||||
return ticket;
|
||||
};
|
||||
|
||||
export default DeleteTicketService;
|
||||
|
||||
Reference in New Issue
Block a user