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}`, {
|
||||
method,
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
Authorization: `Bearer ${token}`,
|
||||
...(body && !chunk ? { 'Content-Type': 'application/json' } : {}),
|
||||
},
|
||||
@@ -72,7 +73,7 @@ export async function publishSkinSite({
|
||||
} catch {
|
||||
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(
|
||||
`Skin site ${route}: ${result?.errorMessage || 'request was rejected or payload is missing'}`,
|
||||
)
|
||||
|
||||
@@ -33,7 +33,8 @@ function apiFixture(bytes, options = {}) {
|
||||
...(state === 'ready' ? { release } : {}),
|
||||
...(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 {
|
||||
chunks,
|
||||
events,
|
||||
|
||||
Reference in new issue
Block a user