mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: delete "deleteSession" method, validate questId and sessionId
This commit is contained in:
1 parent
a7422853fa
commit
5df4967a85
12 files changed
+67
-99
No files matched your search
@@ -45,15 +45,13 @@ async function setSession(session) {
|
||||
|
||||
export async function createSession() {
|
||||
console.log('Creating a new session...')
|
||||
const res = await api.post('/sessions', { quest_id: store.questId })
|
||||
const res = await api.post('/sessions', { questId: store.questId })
|
||||
const { data } = res
|
||||
await setSession(data)
|
||||
}
|
||||
|
||||
async function getActiveSession(questId) {
|
||||
const res = await api.post('/sessions/active', {
|
||||
quest_id: questId,
|
||||
})
|
||||
const res = await api.post('/sessions/active', { questId })
|
||||
const session = res.data
|
||||
try {
|
||||
await setSession(session)
|
||||
|
||||
Reference in new issue
Block a user