X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=assets%2Fcommon%2Fjs%2Fshaare-batch.js;h=6fc16faf1e732d4326411a3458087d9da2d3d5b1;hb=83b4eb17958c0c03bea637db7e394f6d622aeb00;hp=9753137ddf51a9558c26f95ecd4d576bebe647c2;hpb=5b5d22a3df1ba948d39524b997ea4c82ee70e646;p=github%2Fshaarli%2FShaarli.git diff --git a/assets/common/js/shaare-batch.js b/assets/common/js/shaare-batch.js index 9753137d..6fc16faf 100644 --- a/assets/common/js/shaare-batch.js +++ b/assets/common/js/shaare-batch.js @@ -30,9 +30,9 @@ const sendBookmarkForm = (basePath, formElement) => { const sendBookmarkDelete = (buttonElement, formElement) => ( new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); - xhr.open('GET', buttonElement.href); + xhr.open('GET', `${buttonElement.href}&source=batch`); xhr.onload = () => { - if (xhr.status !== 200) { + if (xhr.status !== 204) { alert(`An error occurred. Return code: ${xhr.status}`); reject(); } else { @@ -104,7 +104,7 @@ const redirectIfEmptyBatch = (basePath, formElements, path) => { }); Promise.all(promises).then(() => { - window.location.href = basePath || '/'; + window.location.href = `${basePath}/`; }); }); });