#63 #63 #63 #63 Co-authored-by: miteruzo <miteruzo@naver.com> Reviewed-on: #341
This commit was merged in pull request #341.
This commit is contained in:
@@ -9,11 +9,12 @@ export const postsKeys = {
|
||||
['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 }
|
||||
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,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { apiGet } from '@/lib/api'
|
||||
|
||||
import type { FetchTagsParams, Tag, TagVersion } from '@/types'
|
||||
import type { Deerjikist, FetchTagsParams, Tag, TagVersion } from '@/types'
|
||||
|
||||
|
||||
export const fetchTags = async (
|
||||
@@ -56,3 +56,9 @@ export const fetchTagChanges = async (
|
||||
versions: TagVersion[]
|
||||
count: number }> =>
|
||||
await apiGet ('/tags/versions', { params: { ...(id && { id }), page, limit } })
|
||||
|
||||
|
||||
export const fetchDeerjikistsByTag = async (
|
||||
id: string,
|
||||
): Promise<{ tag: Tag; deerjikists: Deerjikist[]}> =>
|
||||
await apiGet (`/tags/${ id }/deerjikists`)
|
||||
|
||||
Reference in New Issue
Block a user