Added await on postArticle before redirect
This commit is contained in:
1 parent
587301b119
commit
94b42d7e34
1 file changed
+2
-2
@@ -29,7 +29,7 @@ function isFormEmpty(): boolean {
|
|||||||
return title.value === '' || rawTags.value === ''
|
return title.value === '' || rawTags.value === ''
|
||||||
}
|
}
|
||||||
|
|
||||||
function createArticle() {
|
async function createArticle() {
|
||||||
const article: Article = {
|
const article: Article = {
|
||||||
titleID: generateTitleID(title.value),
|
titleID: generateTitleID(title.value),
|
||||||
title: title.value,
|
title: title.value,
|
||||||
@@ -40,7 +40,7 @@ function createArticle() {
|
|||||||
online: false,
|
online: false,
|
||||||
tags: tags.value
|
tags: tags.value
|
||||||
}
|
}
|
||||||
postArticle(article)
|
await postArticle(article)
|
||||||
router.push(`/articles/edit/${article.titleID}`)
|
router.push(`/articles/edit/${article.titleID}`)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in new issue
Block a user