implemented creation of successor document
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user