]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1691 from ArthurHoaro/fix/bulk-add-js-checkboxes
authorArthurHoaro <arthur@hoa.ro>
Tue, 19 Jan 2021 13:30:40 +0000 (14:30 +0100)
committerGitHub <noreply@github.com>
Tue, 19 Jan 2021 13:30:40 +0000 (14:30 +0100)
Fix: bulk add - private status

assets/common/js/shaare-batch.js

index 557325ee373f9c85fc6287674f110096f379e7f1..9753137ddf51a9558c26f95ecd4d576bebe647c2 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) => {