]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - assets/common/js/shaare-batch.js
Merge pull request #1697 from ArthurHoaro/feature/pagination
[github/shaarli/Shaarli.git] / assets / common / js / shaare-batch.js
index 2b438045c5f401ce8a21305278fcd57e8e083b86..6fc16faf1e732d4326411a3458087d9da2d3d5b1 100644 (file)
@@ -4,7 +4,11 @@ const sendBookmarkForm = (basePath, formElement) => {
 
   const formData = new FormData();
   [...inputs].forEach((input) => {
-    formData.append(input.getAttribute('name'), input.value);
+    if (input.getAttribute('type') === 'checkbox') {
+      formData.append(input.getAttribute('name'), input.checked);
+    } else {
+      formData.append(input.getAttribute('name'), input.value);
+    }
   });
 
   return new Promise((resolve, reject) => {
@@ -100,7 +104,7 @@ const redirectIfEmptyBatch = (basePath, formElements, path) => {
         });
 
         Promise.all(promises).then(() => {
-          window.location.href = basePath || '/';
+          window.location.href = `${basePath}/`;
         });
       });
     });