Skip to content

Commit 6466f20

Browse files
upload route thumbnail null
1 parent 13ea2f6 commit 6466f20

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/app/api/upload/route.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export async function POST(req: Request) {
5959

6060
let final_url: string | undefined = "";
6161
let public_id_cloudinary: string | undefined = "";
62-
let thumbnail_url: string | undefined = "";
6362

6463
if (!files || files.length === 0) {
6564
return NextResponse.json(
@@ -93,19 +92,13 @@ export async function POST(req: Request) {
9392
);
9493
}
9594

96-
const thumbnailResponse = cloudinary.v2.image(final_url!, {
97-
format: "jpg",
98-
});
99-
thumbnail_url = thumbnailResponse
100-
.replace("pdf", "jpg")
101-
.replace("upload", "upload/w_400,h_400,c_fill")
102-
.replace(/<img src='|'\s*\/>/g, "");
10395

10496
const paper = new PaperAdmin({
10597
cloudinary_index: configIndex,
98+
10699
public_id_cloudinary,
107100
final_url,
108-
thumbnail_url,
101+
thumbnail_url: null,
109102
subject: null,
110103
slot: null,
111104
year: null,

0 commit comments

Comments
 (0)