fix(ci): match skin site response envelopes
This commit is contained in:
1 parent
f81a588dc1
commit
6edc44fe26
2 files changed
+4
-2
No files matched your search
@@ -43,6 +43,7 @@ export async function publishSkinSite({
|
|||||||
response = await fetchImpl(`${baseUrl.replace(/\/$/, '')}/starlight/${route}`, {
|
response = await fetchImpl(`${baseUrl.replace(/\/$/, '')}/starlight/${route}`, {
|
||||||
method,
|
method,
|
||||||
headers: {
|
headers: {
|
||||||
|
Accept: 'application/json',
|
||||||
Authorization: `Bearer ${token}`,
|
Authorization: `Bearer ${token}`,
|
||||||
...(body && !chunk ? { 'Content-Type': 'application/json' } : {}),
|
...(body && !chunk ? { 'Content-Type': 'application/json' } : {}),
|
||||||
},
|
},
|
||||||
@@ -72,7 +73,7 @@ export async function publishSkinSite({
|
|||||||
} catch {
|
} catch {
|
||||||
throw new Error(`Skin site ${route}: invalid JSON response`)
|
throw new Error(`Skin site ${route}: invalid JSON response`)
|
||||||
}
|
}
|
||||||
if (result?.success !== true || !result.payload) {
|
if (result?.success === false || result?.error || !result?.payload) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Skin site ${route}: ${result?.errorMessage || 'request was rejected or payload is missing'}`,
|
`Skin site ${route}: ${result?.errorMessage || 'request was rejected or payload is missing'}`,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ function apiFixture(bytes, options = {}) {
|
|||||||
...(state === 'ready' ? { release } : {}),
|
...(state === 'ready' ? { release } : {}),
|
||||||
...(state === 'failed' ? { errorMessage: 'Invalid archive manifest' } : {}),
|
...(state === 'failed' ? { errorMessage: 'Invalid archive manifest' } : {}),
|
||||||
})
|
})
|
||||||
const reply = (payload) => Response.json({ success: true, payload })
|
// The frontend derives success from HTTP status; the wire envelope only needs payload.
|
||||||
|
const reply = (payload) => Response.json({ payload })
|
||||||
return {
|
return {
|
||||||
chunks,
|
chunks,
|
||||||
events,
|
events,
|
||||||
|
|||||||
Reference in new issue
Block a user