Skip to content

Commit

Permalink
fix: update auto refretch
Browse files Browse the repository at this point in the history
  • Loading branch information
potts99 committed Nov 7, 2024
1 parent 237d903 commit 2c29003
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
10 changes: 6 additions & 4 deletions apps/client/pages/issues/closed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export default function Tickets() {
const { t } = useTranslation("peppermint");

const token = getCookie("session");
const { data, status, error } = useQuery("allusertickets", () =>
getUserTickets(token)
const { data, status, error } = useQuery(
"allusertickets",
() => getUserTickets(token),
{
refetchInterval: 1000,
}
);

const user = useUser();
Expand All @@ -69,8 +73,6 @@ export default function Tickets() {
)
: [];

console.log(data);

return (
<div>
{status === "loading" && (
Expand Down
8 changes: 6 additions & 2 deletions apps/client/pages/issues/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ export default function Tickets() {
const { t } = useTranslation("peppermint");

const token = getCookie("session");
const { data, status, error } = useQuery("allusertickets", () =>
getUserTickets(token)
const { data, status, error } = useQuery(
"allusertickets",
() => getUserTickets(token),
{
refetchInterval: 1000,
}
);

const user = useUser();
Expand Down
8 changes: 6 additions & 2 deletions apps/client/pages/issues/open.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ export default function Tickets() {
const { t } = useTranslation("peppermint");

const token = getCookie("session");
const { data, status, error } = useQuery("allusertickets", () =>
getUserTickets(token)
const { data, status, error } = useQuery(
"allusertickets",
() => getUserTickets(token),
{
refetchInterval: 1000,
}
);

const user = useUser();
Expand Down

0 comments on commit 2c29003

Please sign in to comment.