Article GET route now returns Array

This commit is contained in:
Florian Sylvain
2023-01-09 17:37:22 +01:00
parent c818e15aff
commit 71e305766c
6 changed files with 16 additions and 20 deletions
+3 -2
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { getArticle, type Article } from '@/utils/database';
import { getArticles, type Article } from '@/utils/database';
import Editor from '@tinymce/tinymce-vue';
import { onMounted, ref, type Ref } from 'vue';
import { useRoute } from 'vue-router';
@@ -8,7 +8,8 @@ const article: Ref<Article | void> = ref()
const editorData: Ref<string> = ref('')
onMounted(async () => {
article.value = await getArticle(useRoute().params.articleID as string)
const articleFetch = await getArticles(useRoute().params.articleID as string)
article.value = articleFetch[0]
editorData.value = article.value.content.html
})