thainv-dev: page chi tiết

This commit is contained in:
nguyen van thai
2024-05-31 12:39:53 +07:00
parent 86bebfd66e
commit 6ff759f22a
15 changed files with 348 additions and 14 deletions
+4 -3
View File
@@ -62,12 +62,13 @@ export const getArticleById = async (event : any) => {
try {
const { apiUrl } = useRuntimeConfig().public
const id = event.context.params.id;
const { item }: any = await $fetch(`${apiUrl}/cms/digital-Article/${id}`, {
const { item }: any = await $fetch(`${apiUrl}/cms/digital-article/${id}`, {
headers: new Headers({
site: '1' || 1,
}),
})
return item
return { item }
} catch (error) {
handleError(error);
}
@@ -77,7 +78,7 @@ export const getArticleBySlug = async (event : any) => {
try {
const { apiUrl } = useRuntimeConfig().public
const slug = event.context.params.slug;
const { item }: any = await $fetch(`${apiUrl}/cms/digital-Article/slug:${slug}`, {
const { item }: any = await $fetch(`${apiUrl}/cms/digital-article/slug:${slug}`, {
headers: new Headers({
site: '1' || 1,
}),