mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
refactor: migrate session management to TRPC and remove legacy API endpoints
This commit is contained in:
1 parent
b4b8f8baee
commit
92173bb7e9
7 files changed
+71
-191
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { FileGraph, FileObject } from '@linux-odyssey/file-graph'
|
||||
import { IResponse, ITask } from '@linux-odyssey/game'
|
||||
import { createSession, getActiveSession } from '../utils/api'
|
||||
import Socket from '../utils/socket'
|
||||
import SocketTerminal from '../utils/terminal'
|
||||
import { Session } from '../types'
|
||||
@@ -50,7 +49,9 @@ const useSession = defineStore('session', {
|
||||
term.focus()
|
||||
},
|
||||
async createSession() {
|
||||
const session = await createSession(this.questId)
|
||||
const session = await trpc.session.createSession.mutate({
|
||||
questId: this.questId,
|
||||
})
|
||||
await this.setSession(session)
|
||||
socket.emit('terminal', 'echo start\n')
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user