feat: migrate quest api to trpc

This commit is contained in:
Justin Lin committed 2025-04-16 16:24:29 +08:00
1 parent 55a41dd3b5
commit ac92950177
14 files changed
+55 -71

No files matched your search

-11
View File
@@ -1,5 +1,4 @@
import axios from 'axios'
import { IQuest } from '@linux-odyssey/models'
import { GetSessionsRequest } from '@linux-odyssey/constants'
import { Session } from '../types'
import { UserProfile } from '../store/userProfile'
@@ -18,11 +17,6 @@ export async function getUserProfile(): Promise<UserProfile> {
return res.data
}
export async function getQuest(id: string): Promise<IQuest> {
const res = await api.get<IQuest>(`/quests/${id}`)
return res.data
}
export async function createSession(questId: string): Promise<Session> {
const res = await api.post<Session>('/sessions', { questId })
return res.data
@@ -43,8 +37,3 @@ export async function getActiveSession(
})
return res.data
}
export async function getQuests(): Promise<IQuest[]> {
const res = await api.get<IQuest[]>('/quests')
return res.data
}