From 51cb74b7ca786087ab277c1bb2ec82fabc11dd95 Mon Sep 17 00:00:00 2001 From: JeetJani-11 Date: Fri, 26 Jul 2024 12:43:10 +0530 Subject: [PATCH] Fixed Poster Path --- src/app/api/v1/get/blog/route.ts | 2 +- src/app/api/v1/get/blogs/route.ts | 2 +- src/app/api/v1/submit/blog/route.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/api/v1/get/blog/route.ts b/src/app/api/v1/get/blog/route.ts index 1dcf81a..09ad635 100644 --- a/src/app/api/v1/get/blog/route.ts +++ b/src/app/api/v1/get/blog/route.ts @@ -26,7 +26,7 @@ export async function GET(request: NextRequest): Promise { ); } - const posterUrl = `${process.env.SUPABASE_STORAGE_URL}/web_data/blogs/${id}/poster`; + const posterUrl = `${process.env.SUPABASE_STORAGE_URL}/web_data/images/${id}/poster`; const blogFileUrl = `${process.env.SUPABASE_STORAGE_URL}/web_data/blogs/${id}/blog`; const { data: images, error: imagesError } = await supabase diff --git a/src/app/api/v1/get/blogs/route.ts b/src/app/api/v1/get/blogs/route.ts index b5ed4be..540bddd 100644 --- a/src/app/api/v1/get/blogs/route.ts +++ b/src/app/api/v1/get/blogs/route.ts @@ -32,7 +32,7 @@ export async function GET(request: NextRequest): Promise { const blogPromises = blogs.map(async (blog) => { - const posterUrl = `${process.env.SUPABASE_STORAGE_URL}/web_data/blogs/${blog.id}/poster`; + const posterUrl = `${process.env.SUPABASE_STORAGE_URL}/web_data/images/${blog.id}/poster`; const blogFileUrl = `${process.env.SUPABASE_STORAGE_URL}/web_data/blogs/${blog.id}/blog`; const { data: images, error: imagesError } = await supabase diff --git a/src/app/api/v1/submit/blog/route.ts b/src/app/api/v1/submit/blog/route.ts index c75880e..758d8e0 100644 --- a/src/app/api/v1/submit/blog/route.ts +++ b/src/app/api/v1/submit/blog/route.ts @@ -71,7 +71,7 @@ export async function POST(request: NextRequest): Promise { .upload(`blogs/${blogId}/blog`, blogFile), supabase.storage .from("web_data") - .upload(`blogs/${blogId}/poster`, poster), + .upload(`images/${blogId}/poster`, poster), ]; if (images.length > 0) { images.forEach((image: File) => {