From 51df73935e4816d440b5659f77451de127c60da3 Mon Sep 17 00:00:00 2001 From: hkirat Date: Wed, 14 Aug 2024 08:13:02 +0530 Subject: [PATCH] Updated bunnyUrl --- src/app/admin/content/[courseId]/[...moduleId]/page.tsx | 2 ++ src/app/admin/content/[courseId]/page.tsx | 1 + src/components/admin/ContentRenderer.tsx | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/admin/content/[courseId]/[...moduleId]/page.tsx b/src/app/admin/content/[courseId]/[...moduleId]/page.tsx index 25d8bf512..4d30c6ea2 100644 --- a/src/app/admin/content/[courseId]/[...moduleId]/page.tsx +++ b/src/app/admin/content/[courseId]/[...moduleId]/page.tsx @@ -23,6 +23,7 @@ export default async function UpdateCourseContent({ if (contentType === 'video') { return (
+ {/* @ts-ignore */}
); @@ -47,6 +48,7 @@ export default async function UpdateCourseContent({ /> ({ title: x?.title || '', image: x?.thumbnail || '', diff --git a/src/app/admin/content/[courseId]/page.tsx b/src/app/admin/content/[courseId]/page.tsx index eeb28977d..b397c2e3b 100644 --- a/src/app/admin/content/[courseId]/page.tsx +++ b/src/app/admin/content/[courseId]/page.tsx @@ -45,6 +45,7 @@ export default async function UpdateCourseContent({ /> ({ title: x?.title || '', image: x?.thumbnail || '', diff --git a/src/components/admin/ContentRenderer.tsx b/src/components/admin/ContentRenderer.tsx index 4032c58da..e29bc143a 100644 --- a/src/components/admin/ContentRenderer.tsx +++ b/src/components/admin/ContentRenderer.tsx @@ -4,7 +4,8 @@ import { authOptions } from '@/lib/auth'; import { ContentRendererClient } from './ContentRendererClient'; import { Bookmark } from '@prisma/client'; -function bunnyUrl(url: string) { +function bunnyUrl(url?: string) { + if (!url) return ''; return url .replace('https://appxcontent.kaxa.in', 'https://appxcontent.b-cdn.net') .replace(