forked from ryanmwangi/CalMerger
proceed if only all URLs are valid
This commit is contained in:
parent
3ffd34190f
commit
ccc8847713
|
@ -34,6 +34,7 @@ const form = document.getElementById('merge-form');
|
||||||
const prefix = document.getElementById(`prefix-${i}`);
|
const prefix = document.getElementById(`prefix-${i}`);
|
||||||
const override = document.getElementById(`override-${i}`);
|
const override = document.getElementById(`override-${i}`);
|
||||||
const url = document.getElementById(`url-${i}`);
|
const url = document.getElementById(`url-${i}`);
|
||||||
|
|
||||||
if (prefix && override && url) {
|
if (prefix && override && url) {
|
||||||
// Validate the URL
|
// Validate the URL
|
||||||
if (!isValidUrl(url.value)) {
|
if (!isValidUrl(url.value)) {
|
||||||
|
@ -48,6 +49,7 @@ const form = document.getElementById('merge-form');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (valid) {
|
||||||
fetch('/merge', {
|
fetch('/merge', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -69,4 +71,5 @@ const form = document.getElementById('merge-form');
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
result.innerHTML = `Error merging calendars: ${error.message || 'Unknown error'}`
|
result.innerHTML = `Error merging calendars: ${error.message || 'Unknown error'}`
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
Loading…
Reference in New Issue