From 2b8ed115be6be52a0ee95b11124265a070319647 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 13 Apr 2024 19:33:31 -0400 Subject: [PATCH] insert data --- index.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 283e34b..2804bb9 100644 --- a/index.js +++ b/index.js @@ -78,7 +78,30 @@ app.post('/upload/task', upload.single('file'), (req, res) => { fs.rename(oldPath, newPath, function (err) { if (err) throw err - console.log('Successfully renamed - AKA moved!') + console.log('Successfully renamed - AKA moved!'); + console.log('Start::Database Registration!'); + + var data = { + "member_uid": req.body.uid, + "job_uid": req.body.job_uid, + "filename": req.file.filename, + "originalname": req.file.originalname, + "mimetype": req.file.mimetype, + "size": req.file.size, + "encoding": req.file.encoding + }; + + console.log("DATA - > ", data) + var queryText = 'INSERT INTO members_jobs_files( request ) VALUES($1) RETURNING id' + db.query(queryText, [data], function(dbErr, result) { + if (dbErr) { + + + }else{ + + + } + console.log('End::Database Registration!'); }) return res.status(200).send('Completed') })