mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 03:39:29 +00:00
feat: show pending messages in appbar
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React, { useState } from "react";
|
||||
import { useHistory } from "react-router-dom";
|
||||
|
||||
import { toast } from "react-toastify";
|
||||
|
||||
@@ -11,11 +12,13 @@ import ConfirmationModal from "../ConfirmationModal";
|
||||
|
||||
const TicketOptionsMenu = ({ ticket, menuOpen, handleClose, anchorEl }) => {
|
||||
const [confirmationOpen, setConfirmationOpen] = useState(false);
|
||||
const history = useHistory();
|
||||
|
||||
const handleDeleteTicket = async () => {
|
||||
try {
|
||||
await api.delete(`/tickets/${ticket.id}`);
|
||||
toast.success("Ticket deletado com sucesso.");
|
||||
history.push("/chat");
|
||||
} catch (err) {
|
||||
toast.error("Erro ao deletar o ticket");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user