Browse Source

fix username

pull/3/head
rozetko 2 years ago
parent
commit
f3b52778c4
  1. 11
      src/routes/tasks.ts

11
src/routes/tasks.ts

@ -34,19 +34,14 @@ async function getTasks(req, res) {
// TODO: read async // TODO: read async
let data = fs.readFileSync(path.join(EXPORTED_PATH, item), 'utf8'); let data = fs.readFileSync(path.join(EXPORTED_PATH, item), 'utf8');
let status = JSON.parse(data); let status = JSON.parse(data);
let filename = '';
if(status.status === 'finished') {
filename = file.name;
}
resp.push({ resp.push({
timestamp: status.time, timestamp: status.time,
username: status.user, username: status.username,
datasourceRef: status.datasourceRef, datasourceRef: status.datasourceRef,
rowsCount: status.exportedRows, rowsCount: status.exportedRows,
progress: status.progress, progress: status.progress,
status: status.status, status: status.status,
filename, filename: file.name,
}); });
} }
@ -85,7 +80,7 @@ async function addTask(req: TRequest, res) {
} }
async function deleteTask(req, res) { async function deleteTask(req, res) {
let filename = req.query.filename; let filename = req.body.filename;
let csvFilePath = path.join(EXPORTED_PATH, `${filename}.csv`); let csvFilePath = path.join(EXPORTED_PATH, `${filename}.csv`);
let jsonFilePath = path.join(EXPORTED_PATH, `${filename}.json`); let jsonFilePath = path.join(EXPORTED_PATH, `${filename}.json`);

Loading…
Cancel
Save