From b940f07515705217705fc29b3606dae1dffa6b27 Mon Sep 17 00:00:00 2001 From: Foyzul Karim Date: Sun, 8 Oct 2023 21:18:58 +1100 Subject: [PATCH] Fix uploading to DO --- server/src/modules/models/video/controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/modules/models/video/controller.js b/server/src/modules/models/video/controller.js index 7d393ed..5cee21c 100644 --- a/server/src/modules/models/video/controller.js +++ b/server/src/modules/models/video/controller.js @@ -179,14 +179,14 @@ const setupRoutes = (app) => { const dbPayload = { ...req.body, - fileName: req.file.filename, + fileName: req.file.originalname, originalName: req.file.originalname, recordingDate: new Date(), - videoLink: req.file.path, + videoLink: req.file.location, viewCount: 0, duration: 0, }; - logger.info('dbPayload', dbPayload); + logger.info('dbPayload', { dbPayload }); // TODO: save the file info and get the id from the database const result = await insert(dbPayload); logger.info('result', result);