From 4a88b0a5eccc3980c653f421447e72520a2bfe82 Mon Sep 17 00:00:00 2001 From: Ryan Mwangi Date: Fri, 25 Oct 2024 14:54:25 +0300 Subject: [PATCH] remove refresh calendar button event listener --- script.js | 28 ---------------------------- 1 file changed, 28 deletions(-) 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.'); - } -}); -