This commit is contained in:
2026-10-19 00:57:56 +07:00
parent 5635b8b5b1
commit 7fa0004ab9
7 changed files with 20 additions and 15 deletions
+4 -4
View File
@@ -329,7 +329,7 @@ export async function prepareScreenPackage(
: meta.method === 'GetScreenPlan'
? '/screen-plan'
: ''
const safePath = meta.method === 'GetScenario' ? '/api/scenarios/{id}' : `/api/games/{id}${suffix}`
const safePath = meta.method === 'GetFullScenario' ? '/api/scenarios/{id}/full' : `/api/games/{id}${suffix}`
let response: Response
try {
response = await fetchAPI(`${server}/${requestData.path}`, {
@@ -397,7 +397,7 @@ export async function prepareScreenPackage(
let response
let received = false
try {
response = await client.GetScenario({ ID: scenarioId })
response = await client.GetFullScenario({ ID: scenarioId })
received = true
} catch (error) {
if (signal.aborted || error instanceof SessionChangedError || (error instanceof ApiError && error.status === 401)) throw error
@@ -413,7 +413,7 @@ export async function prepareScreenPackage(
gameData.scenario = { ...scenario, ...full, story: full.story }
if (full.story == null) request.onIncomplete?.()
} catch (error) {
throw requestErrorContext(error, 'GetScenario', 'GET', `/api/scenarios/${scenarioId}`)
throw requestErrorContext(error, 'GetFullScenario', 'GET', `/api/scenarios/${scenarioId}/full`)
}
}
} else if (scenario.story == null) request.onIncomplete?.()
@@ -422,7 +422,7 @@ export async function prepareScreenPackage(
} catch (error) {
const field = error instanceof ResponseFieldError ? error.field : 'game'
if (fullScenarioId !== null && field.startsWith('game.scenario.'))
throw requestErrorContext(error, 'GetScenario', 'GET', `/api/scenarios/${fullScenarioId}`)
throw requestErrorContext(error, 'GetFullScenario', 'GET', `/api/scenarios/${fullScenarioId}/full`)
const state = field.startsWith('state.')
const suffix = field.startsWith('plan')
? '/screen-plan'