@@ -25,7 +25,7 @@ cloudinary.v2.config({
2525 api_key : process . env . CLOUDINARY_API_KEY ,
2626 api_secret : process . env . CLOUDINARY_SECRET ,
2727} ) ;
28- type SemesterType = IAdminPaper [ "semester" ] ; // Extract the exam type from the IPaper interface
28+ type SemesterType = IAdminPaper [ "semester" ] ;
2929
3030const config1 = {
3131 cloud_name : process . env . NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME_1 ,
@@ -54,7 +54,7 @@ export async function POST(req: Request) {
5454 const uploadPreset = process . env . NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET ;
5555 const formData = await req . formData ( ) ;
5656 const files : File [ ] = formData . getAll ( "files" ) as File [ ] ;
57- const isPdf = formData . get ( "isPdf" ) === "true" ; // Convert string to boolean
57+ const isPdf = formData . get ( "isPdf" ) === "true" ;
5858
5959 let pdfData = "" ;
6060
@@ -129,8 +129,6 @@ export async function POST(req: Request) {
129129 ) ;
130130 }
131131
132- // If all checks pass, continue with the rest of the logic
133-
134132 let finalUrl : string | undefined = "" ;
135133 let public_id_cloudinary : string | undefined = "" ;
136134 let thumbnailUrl : string | undefined = "" ;
@@ -255,7 +253,7 @@ async function CreatePDF(orderedFiles: File[]) {
255253 return mergedPdfBytes ;
256254}
257255
258- //sets course-name to corresponding course name from our api
256+ // Sets course-name to corresponding course name from our api
259257async function setTagsFromCurrentLists (
260258 tags : ExamDetail | undefined ,
261259 courses : string [ ] ,
@@ -309,7 +307,7 @@ async function setTagsFromCurrentLists(
309307 return newTags ;
310308}
311309function findMatch < T > ( arr : T [ ] , value : string | undefined ) : T | undefined {
312- if ( ! value ) return undefined ; // Handle undefined case
310+ if ( ! value ) return undefined ;
313311 const pattern = new RegExp ( value , "i" ) ;
314312 return arr . find ( ( item ) => pattern . test ( String ( item ) ) ) ;
315313}
0 commit comments