minhnt-dev: SEO

This commit is contained in:
MoreStrive
2024-06-21 17:51:36 +07:00
parent a447a8a7aa
commit e151dda2ad
7 changed files with 23 additions and 11 deletions
+2 -2
View File
@@ -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) { }
}
+2 -2
View File
@@ -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();