implemented state update after sending document, returning to document list

This commit is contained in:
2025-07-17 21:16:37 +02:00
parent 6a58087ace
commit 763e5b447b
8 changed files with 43 additions and 13 deletions

View File

@@ -37,13 +37,13 @@
async function doSend(){
var data = {email:email,subject:subject,content:content};
const url = `${location.protocol}//${location.host.replace('5173','8080')}/api/document/${id}/send`;
const resp = fetch(url,{
const resp = await fetch(url,{
credentials:'include',
method: 'POST',
body: JSON.stringify(data)
});
if (resp.ok){
router.navigate('/document');
router.navigate(`/document?company_id=${doc.company.id}`);
} else {
error = await resp.text();
}