refactor: tighten upload and viewer contracts

This commit is contained in:
Tom Boullay
2026-05-13 17:50:26 +02:00
parent 30ff9826dc
commit f6ac71dad2
11 changed files with 108 additions and 86 deletions
+3 -2
View File
@@ -202,7 +202,8 @@ async function uploadToLfsBatch(
throw new Error(`LFS batch request failed (${batchRes.status}): ${text}`)
}
const batchObjects = parseLfsBatchResponse(await batchRes.json())
const batchData: unknown = await batchRes.json()
const batchObjects = parseLfsBatchResponse(batchData)
const objectMap = new Map(objects.map((o) => [o.oid, o]))
@@ -277,7 +278,7 @@ export async function getRemoteFolder(
})
if (!Array.isArray(data)) {
return { exists: false, files: [] }
throw new Error(`Le chemin distant ${folderPath} existe mais ce n'est pas un dossier`)
}
const files: RemoteFile[] = await Promise.all(