insert data

This commit is contained in:
CHIEFSOFT\ameye
2024-04-13 19:33:31 -04:00
parent c5a9b63086
commit 2b8ed115be
+24 -1
View File
@@ -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')
})