Skip to content

Commit

Permalink
style: ticket status
Browse files Browse the repository at this point in the history
  • Loading branch information
oproprioleonardo committed Oct 26, 2024
1 parent 8619753 commit fb54bc1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/ticket/Ticket.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import {Event, Ticket} from "@/models";
import {Event, Ticket, TicketStatus} from "@/models";
import "./style.css";
import {consumeTicket, getTicket} from "@/server-actions/ticket.action";
import {getUser} from "@/server-actions/user.action";
Expand All @@ -23,7 +23,11 @@ export default function TicketUI({id}: { id: string }) {
setLoading(true);
const resp = await consumeTicket(id);
if (resp.error) toast.error(resp.error, toastConfig);
else toast.success("Ticket validado com sucesso!", toastConfig);
else {
toast.success("Ticket validado com sucesso!", toastConfig);
// @ts-ignore
setTicket((ticket) => ({...ticket, status: TicketStatus.CONSUMED}));
}
setLoading(false);
};

Expand Down

0 comments on commit fb54bc1

Please sign in to comment.