implemented state update after sending document, returning to document list
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user