minhnt-dev: get by slug

This commit is contained in:
MoreStrive
2024-05-31 15:04:22 +07:00
parent 7b01ce6170
commit 892bddde2f
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ export const useArticleStore = defineStore("article", () => {
} catch (error: any) {}
}
const getArticleByCode = async (slug: string) => {
const getArticleBySlug = async (slug: string) => {
try {
const { data} = await useFetch(`/api/articles/get-by-slug/${slug}`)
currentArticle.value = {}
@@ -21,7 +21,7 @@ export const useArticleStore = defineStore("article", () => {
return {
currentArticle,
getArticleById,
getArticleByCode
getArticleBySlug
}
});