diff --git a/src/routes/services/[id]/_Services/_Services.svelte b/src/routes/services/[id]/_Services/_Services.svelte index d1d638bb4..062292c4d 100644 --- a/src/routes/services/[id]/_Services/_Services.svelte +++ b/src/routes/services/[id]/_Services/_Services.svelte @@ -38,7 +38,7 @@ try { await post(`/services/${id}/check.json`, { fqdn: service.fqdn, - otherFqdns: [service.minio.apiFqdn], + otherFqdns: service.minio?.apiFqdn ? [service.minio?.apiFqdn] : [], exposePort: service.exposePort }); await post(`/services/${id}/${service.type}.json`, { ...service }); diff --git a/src/routes/services/[id]/check.json.ts b/src/routes/services/[id]/check.json.ts index 4b8557c66..4201e94da 100644 --- a/src/routes/services/[id]/check.json.ts +++ b/src/routes/services/[id]/check.json.ts @@ -13,7 +13,7 @@ export const post: RequestHandler = async (event) => { let { fqdn, exposePort, otherFqdns } = await event.request.json(); if (fqdn) fqdn = fqdn.toLowerCase(); - if (otherFqdns) otherFqdns = otherFqdns.map((fqdn) => fqdn.toLowerCase()); + if (otherFqdns && otherFqdns.length > 0) otherFqdns = otherFqdns.map((f) => f.toLowerCase()); if (exposePort) exposePort = Number(exposePort); try { @@ -25,7 +25,7 @@ export const post: RequestHandler = async (event) => { }) }; } - if (otherFqdns) { + if (otherFqdns && otherFqdns.length > 0) { for (const ofqdn of otherFqdns) { const domain = getDomain(ofqdn); const nakedDomain = domain.replace('www.', '');