async function move()

in ui/src/main/frontend/js/editor.js [182:216]


          async function move() {
            const formData = new FormData();
            formData.append("_charset_", "utf-8");
            if (sourcePath !== targetPath) {
              formData.append(":dest", targetPath);
              formData.append(":operation", "move");
            }
            formData.append(":nameHint", sourceName);
            formData.append(":order", evt.target.dataset.order);
            let ui;
            if (typeof Sling !== "undefined") {
              ui = Sling.CMS.ui;
            } else {
              ui = window.parent.Sling.CMS.ui;
            }
            const response = await fetch(sourcePath, {
              method: "POST",
              body: formData,
              cache: "no-cache",
              headers: {
                Accept: "application/json",
              },
            });
            const res = await response.json();
            if (!response.ok) {
              ui.confirmMessage(
                "Failed to move",
                res["status.message"] || response.statusText,
                () => {}
              );
            } else {
              ui.confirmReload(res, "success");
            }
            evt.target.classList.remove("sling-cms-droptarget__is-over");
          }