Article edition now getting article from DB by ID

This commit is contained in:
Florian Sylvain
2023-01-06 23:28:06 +01:00
parent ea8468aa93
commit 322c77549c
3 changed files with 35 additions and 5 deletions
+8 -2
View File
@@ -1,11 +1,17 @@
<script setup lang="ts">
import { getArticle, type Article } from '@/utils/database';
import Editor from '@tinymce/tinymce-vue';
import { ref, type Ref } from 'vue';
import { onMounted, ref, type Ref } from 'vue';
import { useRoute } from 'vue-router';
const articleID = useRoute().params.articleID
let article: Ref<Article | void> = ref()
const editorData: Ref<string> = ref('')
onMounted(async () => {
article.value = await getArticle(useRoute().params.articleID as string)
editorData.value = article.value.content.html
})
function abort() {
}