correct syntax error

This commit is contained in:
Ryan Mwangi 2024-10-21 19:41:41 +03:00
parent 707e085fe7
commit 3ffd34190f
1 changed files with 11 additions and 10 deletions

View File

@ -36,15 +36,16 @@ const form = document.getElementById('merge-form');
const url = document.getElementById(`url-${i}`);
if (prefix && override && url) {
// Validate the URL
if (!isValidUrl(url.value)) {
valid = false; // Set flag to false if any URL is invalid
alert(`Invalid URL format for calendar ${i + 1}: ${url.value}`);
} else {
calendarsData.push({
prefix: prefix.value,
override: override.checked,
url: url.value
});
if (!isValidUrl(url.value)) {
valid = false; // Set flag to false if any URL is invalid
alert(`Invalid URL format for calendar ${i + 1}: ${url.value}`);
} else {
calendarsData.push({
prefix: prefix.value,
override: override.checked,
url: url.value
});
}
}
}
fetch('/merge', {