minhnt-dev: get by slug
This commit is contained in:
+2
-2
@@ -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
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user