fix tauri throwing error when api returns 204 No Content

This commit is contained in:
tdgao
2026-03-20 12:58:48 -06:00
parent 672757c295
commit 83202a3761
+5 -2
View File
@@ -103,8 +103,11 @@ export class TauriModrinthClient extends XHRUploadClient {
throw error
}
const data = await response.json()
return data as T
const text = await response.text()
if (!text) {
return undefined as T
}
return JSON.parse(text) as T
} catch (error) {
throw this.normalizeError(error)
}