thainv-dev: page chi tiết
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user