fix: Otherfqdns

This commit is contained in:
Andras Bacsai 2022-05-31 11:35:04 +02:00
parent c63430e342
commit f71b54deb2
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@
try { try {
await post(`/services/${id}/check.json`, { await post(`/services/${id}/check.json`, {
fqdn: service.fqdn, fqdn: service.fqdn,
otherFqdns: [service.minio.apiFqdn], otherFqdns: service.minio?.apiFqdn ? [service.minio?.apiFqdn] : [],
exposePort: service.exposePort exposePort: service.exposePort
}); });
await post(`/services/${id}/${service.type}.json`, { ...service }); await post(`/services/${id}/${service.type}.json`, { ...service });

View File

@ -13,7 +13,7 @@ export const post: RequestHandler = async (event) => {
let { fqdn, exposePort, otherFqdns } = await event.request.json(); let { fqdn, exposePort, otherFqdns } = await event.request.json();
if (fqdn) fqdn = fqdn.toLowerCase(); 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); if (exposePort) exposePort = Number(exposePort);
try { try {
@ -25,7 +25,7 @@ export const post: RequestHandler = async (event) => {
}) })
}; };
} }
if (otherFqdns) { if (otherFqdns && otherFqdns.length > 0) {
for (const ofqdn of otherFqdns) { for (const ofqdn of otherFqdns) {
const domain = getDomain(ofqdn); const domain = getDomain(ofqdn);
const nakedDomain = domain.replace('www.', ''); const nakedDomain = domain.replace('www.', '');