minhnt-dev: only ssr
This commit is contained in:
+4
-5
@@ -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) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user