Skip to content

Commit

Permalink
save btn
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Mar 26, 2024
1 parent e3f4c4f commit fe17507
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions apps/client/pages/ticket/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export default function Ticket() {
}),
})
.then((res) => res.json())
.then(() => refetch());
.then(() => {
setEdit(false);
refetch();
});
}

async function updateStatus() {
Expand Down Expand Up @@ -338,7 +341,7 @@ export default function Ticket() {
</p>
</div>
<div className="mt-4 flex space-x-3 md:mt-0">
{!edit && (
{!edit ? (
<DropdownMenu.Root>
<DropdownMenu.Trigger className="hover:cursor-pointer">
<Button variant="outline">Options</Button>
Expand All @@ -363,6 +366,14 @@ export default function Ticket() {
)}
</DropdownMenu.Content>
</DropdownMenu.Root>
) : (
<Button
variant="outline"
className="hover:cursor-pointer"
onClick={() => update()}
>
Save
</Button>
)}
</div>
</div>
Expand Down

0 comments on commit fe17507

Please sign in to comment.