diff --git a/server/utils/helcim.js b/server/utils/helcim.js index a0a28c8..d891612 100644 --- a/server/utils/helcim.js +++ b/server/utils/helcim.js @@ -63,7 +63,13 @@ export async function helcimFetch(path, { method = 'GET', body, idempotencyKey, }) } - return await response.json() + const text = await response.text() + if (!text.trim()) return null + try { + return JSON.parse(text) + } catch { + return null + } } // ---- Customers ----