diff --git a/app/[locale]/(protected)/admin/add-experts/component/table.tsx b/app/[locale]/(protected)/admin/add-experts/component/table.tsx index e1cee274..0614ae37 100644 --- a/app/[locale]/(protected)/admin/add-experts/component/table.tsx +++ b/app/[locale]/(protected)/admin/add-experts/component/table.tsx @@ -170,7 +170,7 @@ const AddExpertTable = () => { async function getCategories() { const category = await listEnableCategory(""); - const resCategory = category.data.data.content; + const resCategory = category?.data?.data?.content; setCategories(resCategory); } diff --git a/app/[locale]/(protected)/admin/broadcast/component/table.tsx b/app/[locale]/(protected)/admin/broadcast/component/table.tsx index fbb67a28..35073096 100644 --- a/app/[locale]/(protected)/admin/broadcast/component/table.tsx +++ b/app/[locale]/(protected)/admin/broadcast/component/table.tsx @@ -174,7 +174,7 @@ const BroadcastTable = () => { async function getCategories() { const category = await listEnableCategory(""); - const resCategory = category.data.data.content; + const resCategory = category?.data?.data?.content; setCategories(resCategory); } diff --git a/components/form/blog/blog-form.tsx b/components/form/blog/blog-form.tsx index e1a79c38..cfddf815 100644 --- a/components/form/blog/blog-form.tsx +++ b/components/form/blog/blog-form.tsx @@ -133,7 +133,7 @@ export default function FormBlog() { // const getCategories = async () => { // try { // const category = await listEnableCategory(fileTypeId); - // const resCategory: Category[] = category.data.data.content; + // const resCategory: Category[] = category?.data?.data?.content; // setCategories(resCategory); // console.log("data category", resCategory); diff --git a/components/form/content/audio-form.tsx b/components/form/content/audio-form.tsx index c9f64e30..1b32da70 100644 --- a/components/form/content/audio-form.tsx +++ b/components/form/content/audio-form.tsx @@ -328,7 +328,7 @@ export default function FormAudio() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/image-ai-form.tsx b/components/form/content/image-ai-form.tsx index 907c7704..2c206dc2 100644 --- a/components/form/content/image-ai-form.tsx +++ b/components/form/content/image-ai-form.tsx @@ -299,7 +299,7 @@ export default function FormImageAI() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index c88eea31..8ab0e508 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -189,7 +189,7 @@ export default function FormImageDetail() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/image-update-form.tsx b/components/form/content/image-update-form.tsx index 4bc6fe05..7252269b 100644 --- a/components/form/content/image-update-form.tsx +++ b/components/form/content/image-update-form.tsx @@ -145,7 +145,7 @@ export default function FormImageUpdate() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/spit-convert-form.tsx b/components/form/content/spit-convert-form.tsx index 4529948d..b2e00c8b 100644 --- a/components/form/content/spit-convert-form.tsx +++ b/components/form/content/spit-convert-form.tsx @@ -167,7 +167,7 @@ export default function FormConvertSPIT() { const getCategories = async () => { try { const category = await listCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/teks-detail-form.tsx b/components/form/content/teks-detail-form.tsx index f491251b..baa234cd 100644 --- a/components/form/content/teks-detail-form.tsx +++ b/components/form/content/teks-detail-form.tsx @@ -180,7 +180,7 @@ export default function FormTeksDetail() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/teks-form.tsx b/components/form/content/teks-form.tsx index e19d7851..8f58d1e3 100644 --- a/components/form/content/teks-form.tsx +++ b/components/form/content/teks-form.tsx @@ -328,7 +328,7 @@ export default function FormTeks() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/teks-update-form.tsx b/components/form/content/teks-update-form.tsx index 70bb68d0..4b492e44 100644 --- a/components/form/content/teks-update-form.tsx +++ b/components/form/content/teks-update-form.tsx @@ -145,7 +145,7 @@ export default function FormTeksUpdate() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/video-detail-form.tsx b/components/form/content/video-detail-form.tsx index f95ac1c4..074c5545 100644 --- a/components/form/content/video-detail-form.tsx +++ b/components/form/content/video-detail-form.tsx @@ -181,7 +181,7 @@ export default function FormVideoDetail() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/video-form.tsx b/components/form/content/video-form.tsx index 6441d06e..0e1f932b 100644 --- a/components/form/content/video-form.tsx +++ b/components/form/content/video-form.tsx @@ -328,7 +328,7 @@ export default function FormVideo() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory); diff --git a/components/form/content/video-update-form.tsx b/components/form/content/video-update-form.tsx index cecfbe75..5a289781 100644 --- a/components/form/content/video-update-form.tsx +++ b/components/form/content/video-update-form.tsx @@ -156,7 +156,7 @@ export default function FormVideoUpdate() { const getCategories = async () => { try { const category = await listEnableCategory(fileTypeId); - const resCategory: Category[] = category.data.data.content; + const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); console.log("data category", resCategory);