minhnt-dev: SEO
This commit is contained in:
+2
-2
@@ -15,9 +15,9 @@ export const useArticleStore = defineStore("article", () => {
|
||||
|
||||
const getArticleBySlug = async (slug: string) => {
|
||||
try {
|
||||
const { data: article } = await useAsyncData('article', () => $fetch(`/api/articles/get-by-slug/${slug}`))
|
||||
const article = await $fetch(`/api/articles/get-by-slug/${slug}`)
|
||||
currentArticle.value = {}
|
||||
currentArticle.value = article.value?.item
|
||||
currentArticle.value = article?.item
|
||||
} catch (error: any) { }
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
|
||||
|
||||
async function fetchPageByCode(slug: any) {
|
||||
try {
|
||||
const { data: { value } } = await useAsyncData('page', () => $fetch(`/api/dynamic-page/get-by-code/${slug}`))
|
||||
const page = await $fetch(`/api/dynamic-page/get-by-code/${slug}`)
|
||||
currentPage.value = {}
|
||||
currentPage.value = value
|
||||
currentPage.value = page
|
||||
|
||||
setSectionPublished();
|
||||
setComponentPublished();
|
||||
|
||||
Reference in New Issue
Block a user