52aa1615b6
#63 #63 #63 #63 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #341
23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import type { FetchPostsParams, FetchTagsParams } from '@/types'
|
|
|
|
export const postsKeys = {
|
|
root: ['posts'] as const,
|
|
index: (p: FetchPostsParams) => ['posts', 'index', p] as const,
|
|
show: (id: string) => ['posts', id] as const,
|
|
related: (id: string) => ['related', id] as const,
|
|
changes: (p: { post?: string; tag?: string; page: number; limit: number }) =>
|
|
['posts', 'changes', p] as const }
|
|
|
|
export const tagsKeys = {
|
|
root: ['tags'] as const,
|
|
index: (p: FetchTagsParams) => ['tags', 'index', p] as const,
|
|
show: (name: string) => ['tags', name] as const,
|
|
changes: (p: { id?: string; page: number; limit: number }) =>
|
|
['tags', 'changes', p] as const,
|
|
deerjikists: (id: string) => ['tags', 'deerjikists', id] as const }
|
|
|
|
export const wikiKeys = {
|
|
root: ['wiki'] as const,
|
|
index: (p: { title?: string }) => ['wiki', 'index', p] as const,
|
|
show: (title: string, p: { version?: string }) => ['wiki', title, p] as const }
|