|
|
@@ -1,5 +1,5 @@
|
|
|
import type { TopicDiscussionConfig } from '@/types/englishSpeaking'
|
|
|
-import { SPEAKING_CONFIG_API_BASE_URL } from '@/views/Editor/EnglishSpeaking/services/speakingApiConfig'
|
|
|
+import { SPEAKING_CONFIG_API_BASE_URL, SPEAKING_DIALOGUE_API_BASE_URL } from '@/views/Editor/EnglishSpeaking/services/speakingApiConfig'
|
|
|
|
|
|
const API_BASE = SPEAKING_CONFIG_API_BASE_URL
|
|
|
|
|
|
@@ -49,8 +49,6 @@ export async function updateSpeakingConfig(
|
|
|
return parse<SpeakingConfigRecord>(res)
|
|
|
}
|
|
|
|
|
|
-import { SPEAKING_DIALOGUE_API_BASE_URL } from '@/views/Editor/EnglishSpeaking/services/speakingApiConfig'
|
|
|
-
|
|
|
const DIALOGUE_BASE = SPEAKING_DIALOGUE_API_BASE_URL
|
|
|
|
|
|
export interface ClassSessionSummary {
|
|
|
@@ -81,8 +79,7 @@ export async function listSpeakingSessionsByConfig(
|
|
|
method: 'GET',
|
|
|
credentials: 'include',
|
|
|
})
|
|
|
- if (!res.ok) throw new Error(`listSpeakingSessionsByConfig failed: ${res.status}`)
|
|
|
- return res.json()
|
|
|
+ return parse<ListSessionsByConfigResponse>(res)
|
|
|
}
|
|
|
|
|
|
export interface ClassSummaryResponse {
|
|
|
@@ -103,6 +100,5 @@ export async function generateClassSummary(
|
|
|
credentials: 'include',
|
|
|
body: JSON.stringify({ configId, userIds, locale }),
|
|
|
})
|
|
|
- if (!res.ok) throw new Error(`generateClassSummary failed: ${res.status}`)
|
|
|
- return res.json()
|
|
|
+ return parse<ClassSummaryResponse>(res)
|
|
|
}
|