significant refactor
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import Page from "@/components/page";
|
||||
import ManageTournaments from "@/features/admin/components/manage-tournaments";
|
||||
import { tournamentQueries } from "@/features/tournaments/queries";
|
||||
import { prefetchServerQuery } from "@/lib/tanstack-query/utils/prefetch";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
|
||||
export const Route = createFileRoute("/_authed/admin/tournaments/")({
|
||||
beforeLoad: async ({ context }) => {
|
||||
const { queryClient } = context;
|
||||
await queryClient.ensureQueryData(tournamentQueries.list());
|
||||
await prefetchServerQuery(queryClient, tournamentQueries.list());
|
||||
},
|
||||
loader: () => ({
|
||||
header: {
|
||||
@@ -14,11 +14,11 @@ export const Route = createFileRoute("/_authed/admin/tournaments/")({
|
||||
title: "Manage Tournaments",
|
||||
},
|
||||
refresh: tournamentQueries.list().queryKey,
|
||||
withPadding: false
|
||||
withPadding: false,
|
||||
}),
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
return <ManageTournaments />
|
||||
return <ManageTournaments />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user