better query key factories
This commit is contained in:
@@ -2,7 +2,7 @@ import { queryOptions } from "@tanstack/react-query";
|
|||||||
import { previewBracket } from "./server";
|
import { previewBracket } from "./server";
|
||||||
|
|
||||||
const bracketKeys = {
|
const bracketKeys = {
|
||||||
preview: (teams: number) => ['bracket-preview', teams] as const,
|
preview: (teams: number) => ['bracket', 'preview', teams] as const,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const bracketQueries = {
|
export const bracketQueries = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { queryOptions } from "@tanstack/react-query";
|
|||||||
import { getTeam } from "./server";
|
import { getTeam } from "./server";
|
||||||
|
|
||||||
const teamKeys = {
|
const teamKeys = {
|
||||||
details: (id: string) => ['teams', id] as const,
|
details: (id: string) => ['teams', 'details', id] as const,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const teamQueries = {
|
export const teamQueries = {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import { queryOptions, useQuery } from "@tanstack/react-query";
|
|||||||
import { getTournament, listTournaments } from "./server";
|
import { getTournament, listTournaments } from "./server";
|
||||||
|
|
||||||
const tournamentKeys = {
|
const tournamentKeys = {
|
||||||
list: ['tournaments'] as const,
|
list: ['tournaments', 'list'] as const,
|
||||||
details: (id: string) => [...tournamentKeys.list, id] as const,
|
details: (id: string) => ['tournaments', 'details', id] as const,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tournamentQueries = {
|
export const tournamentQueries = {
|
||||||
|
|||||||
Reference in New Issue
Block a user