mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
improvement: better error handling
This commit is contained in:
@@ -38,9 +38,6 @@ const setMessagesAsRead = async ticket => {
|
||||
};
|
||||
|
||||
exports.index = async (req, res, next) => {
|
||||
// const wbot = getWbot();
|
||||
// const io = getIO();
|
||||
|
||||
const { ticketId } = req.params;
|
||||
const { searchParam = "", pageNumber = 1 } = req.query;
|
||||
|
||||
@@ -125,6 +122,10 @@ exports.store = async (req, res, next) => {
|
||||
],
|
||||
});
|
||||
|
||||
if (!ticket) {
|
||||
return res.status(404).json({ error: "No ticket found with this ID" });
|
||||
}
|
||||
|
||||
try {
|
||||
if (media) {
|
||||
const newMedia = MessageMedia.fromFilePath(req.file.path);
|
||||
|
||||
Reference in New Issue
Block a user