minhnt-dev: only ssr

This commit is contained in:
MoreStrive
2024-06-21 09:56:34 +07:00
parent 229155b24a
commit 6a275c354e
18 changed files with 84 additions and 1003 deletions
+4 -5
View File
@@ -7,11 +7,10 @@ export const useArticleStore = defineStore("article", () => {
const getArticleById = async (id: string | number) => {
try {
const { data} = await useFetch(`/api/articles/get-by-id/${id}`)
const { data } = await useFetch(`/api/articles/get-by-id/${id}`)
currentArticle.value = {}
currentArticle.value = data.value.item
} catch (error: any) {}
} catch (error: any) { }
}
const getArticleBySlug = async (slug: string) => {
@@ -19,7 +18,7 @@ export const useArticleStore = defineStore("article", () => {
const { data: article } = await useAsyncData('article', () => $fetch(`/api/articles/get-by-slug/${slug}`))
currentArticle.value = {}
currentArticle.value = article.value?.item
} catch (error: any) {}
} catch (error: any) { }
}
const getArticleCondition = async (condition: ArticleCondition) => {
@@ -29,7 +28,7 @@ export const useArticleStore = defineStore("article", () => {
body: condition
})
} catch (error: any) {
}
}