diff --git a/public/js/formHandler.js b/public/js/formHandler.js deleted file mode 100644 index 8ba05a6..0000000 --- a/public/js/formHandler.js +++ /dev/null @@ -1,29 +0,0 @@ -document.getElementById('file-input').addEventListener('change', function() { - const fileName = this.files[0] ? this.files[0].name : 'No file chosen'; - const truncatedFileName = fileName.length > 21 ? fileName.slice(0, 21) + '...' : fileName; - document.querySelector('.file-chosen').textContent = truncatedFileName; -}); - - -export async function processForm (e) { - e.preventDefault(); - // const [name, description, image] = e.target[0,1,2] - const remainingForm = document.getElementById("remainingForm") - remainingForm.style.display = 'none'; - document.getElementById("addMarkerBtn").innerHTML = 'Button Image'; - const markerForm = document.getElementById("markerForm") - const formData = new FormData(markerForm) - document.getElementById("markerFormContainer").style.display = 'none'; - markerForm.reset(); - // const tmpMarker = localStorage.getItem("tmpMarkerId"); - // L.layerGroup().removeLayer(tmpMarker); - await fetch('/uploadMarker', { - method: 'POST', - body: formData, - }).then( async () => { - const map = require('./map'); - await map.fetchNewMarkers(); - } - ) - }; -