update for id bug 29
This commit is contained in:
19
server.js
19
server.js
@ -145,7 +145,6 @@ app.post('/csv', (req, res, next) => {
|
||||
fs.createReadStream(path)
|
||||
.pipe(parse({ delimiter: ",", from_line: 2 }))
|
||||
.on("data", function (row) {
|
||||
|
||||
console.log("--- r-0 ----", row[0]);
|
||||
if(row[0] === _userEmail){
|
||||
_res = row[2];
|
||||
@ -153,15 +152,15 @@ app.post('/csv', (req, res, next) => {
|
||||
|
||||
console.log("--- _res ----", _res);
|
||||
|
||||
if(_res === ""){
|
||||
console.log("--- appending file ----", _res);
|
||||
fs.appendFile(path, csv, function (err) {
|
||||
if (err) throw err;
|
||||
console.log('The "data to append" was appended to file!');
|
||||
});
|
||||
_res = 'OK';
|
||||
//writetoFile(csv);
|
||||
}
|
||||
// if(_res === ""){
|
||||
// console.log("--- appending file ----", _res);
|
||||
// fs.appendFile(path, csv, function (err) {
|
||||
// if (err) throw err;
|
||||
// console.log('The "data to append" was appended to file!');
|
||||
// });
|
||||
// _res = 'OK';
|
||||
// //writetoFile(csv);
|
||||
// }
|
||||
res.send({'id': _res});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user