diff --git a/script.js b/script.js index 94f6949..bd9a5be 100644 --- a/script.js +++ b/script.js @@ -76,31 +76,3 @@ function isValidUrl(url) { }); } }); - - // Refresh button event listener -refreshCalendarsButton.addEventListener('click', () => { - if (mergedUrl) { - // Extract the calendar ID from the URL - const calendarId = mergedUrl.split('/').pop(); - - // Call the server to refresh the merged calendar - fetch(`/refresh/${calendarId}`, { method: 'POST' }) - .then((response) => { - if (!response.ok) { - return response.json().then(err => { throw err; }); - } - return response.json(); - }) - .then((data) => { - result.innerHTML = `Merged calendar URL: ${mergedUrl}`; - console.log('Calendar data refreshed successfully!'); - }) - .catch((error) => { - console.error('Error refreshing calendar data:', error); - result.innerHTML = `Error refreshing calendar data: ${error.message || 'Unknown error'}`; - }); - } else { - alert('No merged calendar URL available to refresh.'); - } -}); -