update for id bug 30

This commit is contained in:
Mohamed Nouffer
2022-11-16 14:30:01 +05:30
parent bdeab44a2f
commit 1b71694761

View File

@ -140,11 +140,14 @@ app.post('/csv', (req, res, next) => {
console.log("--- user data ----", _userData[0].mailadress);
//check for record alredy exist
try {
var _cnt = 0;
const path = '/var/www/html/appexe/natnats/23/bin/mobileweb2/resources/database/user_record.csv';
if (fs.existsSync(path)) {
fs.createReadStream(path)
.pipe(parse({ delimiter: ",", from_line: 2 }))
.pipe(parse({ delimiter: ",", from_line: 1 }))
.on("data", function (row) {
cnt += 1;
if(cnt == 1) return;
console.log("--- r-0 ----", row[0]);
if(row[0] === _userEmail){
_res = row[2];