From c7f33d9160397025507933d7e064e03413a7a2d9 Mon Sep 17 00:00:00 2001
From: Ryan Mwangi <ryannganga13325@gmail.com>
Date: Tue, 15 Oct 2024 14:01:04 +0300
Subject: [PATCH] send one fetch request

---
 script.js | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/script.js b/script.js
index 6a82883..fe47f0a 100644
--- a/script.js
+++ b/script.js
@@ -39,25 +39,12 @@ const form = document.getElementById('merge-form');
             .then((response) => response.json())
             .then((data) => {
                 result.innerHTML = `Merged calendar URL: <a href="${data.url}">${data.url}</a>`;
+                console.log('Links added successfully!');
             })
             .catch((error) => {
                 console.error(error);
                 result.innerHTML = 'Error merging calendars';
             });
-
-            // Send the input data to the server
-            fetch('/add-links', {
-                method: 'POST',
-                headers: { 'Content-Type': 'application/json' },
-                body: JSON.stringify({ calendars: calendarsData })
-            })
-            .then((response) => response.json())
-            .then((data) => {
-                console.log('Links added successfully!');
-                }) .catch((error) => {
-                console.error('Error adding links:', error);
-            });
-            
         });
         
         const refreshInterval = 60 * 60 * 1000; // 1 hour