implemented creation of successor document

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-08-31 14:56:10 +02:00
parent 8d16a93b69
commit 147f169c7b
5 changed files with 54 additions and 5 deletions

View File

@@ -56,8 +56,21 @@
}
}
function createSuccessorDoc(type){
console.log(type);
async function createSuccessorDoc(type){
const url = api(`document/${id}/clone`);
const res = await fetch(url,{
credentials :'include',
method : 'POST',
body : type
});
if (res.ok) {
error = null;
let json = await res.json();
router.navigate(`/document/${json.id}/view`);
loadDoc();
} else {
error = await res.text();
}
}
async function loadDoc(){