mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
Feat: Added 'New ticket" option on ticket list
This commit is contained in:
@@ -48,8 +48,18 @@ exports.index = async (req, res) => {
|
||||
};
|
||||
|
||||
exports.store = async (req, res) => {
|
||||
const io = getIO();
|
||||
const ticket = await Ticket.create(req.body);
|
||||
|
||||
const contact = await ticket.getContact();
|
||||
|
||||
const serializaedTicket = { ...ticket.dataValues, contact: contact };
|
||||
|
||||
io.to("notification").emit("ticket", {
|
||||
action: "create",
|
||||
ticket: serializaedTicket,
|
||||
});
|
||||
|
||||
res.status(200).json(ticket);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user