…
$("#sp-go").onclick=async()=>{const b=$("#sp-go"),say=$("#sp-say"),v=(document.querySelector("input[name=join]:checked")||{}).value||"none";
b.disabled=true;say.textContent="";
- try{await api("PATCH","/api/v2/project",{join:v==="open"?"open":"invite"})}
- catch(e){if(v!=="none"){say.innerHTML="Couldn't set who can join ("+msg(e).replace(/[<&]/g,"")+"). Set it in <a href=\"/d2admin/members\">Settings › Members</a>, or press again to go on.";b.disabled=false;b.dataset.skip="1";if(!b.dataset.tried){b.dataset.tried="1";return}}}
- try{await api("POST","/api/v2/project/home",{to:"dashboard"});go("/")}catch(e){say.textContent=msg(e);b.disabled=false}};
+ // who can join, then the dashboard becomes home (P-1216: PATCH /api/v2/project {join}; no members and by invite are both join invite)
+ try{await api("PATCH","/api/v2/project",{join:v==="open"?"open":"invite"});await api("POST","/api/v2/project/home",{to:"dashboard"});go("/")}
+ catch(e){say.textContent=msg(e);b.disabled=false}};
})();
</script>
…