From cde5ce78c55e8bc6d781ffb41ea5e2b775b176a6 Mon Sep 17 00:00:00 2001 From: Sushant Date: Thu, 21 Nov 2024 09:42:38 +0530 Subject: [PATCH 1/2] Small fix for file url --- src/routes/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/routes/index.ts b/src/routes/index.ts index ea784c1..f8d986c 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -71,6 +71,7 @@ routes.post('/upload', upload.single('file'), async (req, res) => { if (!headers) { return res.status(400).send('Invalid CSV file format'); } + const fileUrl = saveCsvToTmp(file.buffer, file.originalname); try { const fileUrl = saveCsvToTmp(file.buffer, file.originalname); const uploadResult = await uploadToMinio(fileUrl, file.originalname, bucket as string, file.mimetype); From 2498246826e866bd11410c05f461a3ad3ee88603 Mon Sep 17 00:00:00 2001 From: Sushant Date: Thu, 21 Nov 2024 09:43:49 +0530 Subject: [PATCH 2/2] Small fix for file url --- src/routes/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/routes/index.ts b/src/routes/index.ts index f8d986c..747131b 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -73,7 +73,6 @@ routes.post('/upload', upload.single('file'), async (req, res) => { } const fileUrl = saveCsvToTmp(file.buffer, file.originalname); try { - const fileUrl = saveCsvToTmp(file.buffer, file.originalname); const uploadResult = await uploadToMinio(fileUrl, file.originalname, bucket as string, file.mimetype); // Clean up the temporary file fs.unlinkSync(fileUrl);