]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1693 from ArthurHoaro/fix/bulk-add-delete
authorArthurHoaro <arthur@hoa.ro>
Tue, 19 Jan 2021 13:31:15 +0000 (14:31 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Jan 2021 13:31:15 +0000 (14:31 +0100)
Fix: bulk add - delete existing link

assets/common/js/shaare-batch.js

index 2b438045c5f401ce8a21305278fcd57e8e083b86..4a1fdb2ed928ac59962c7bded70554ab3631bf4f 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) => {