From f3b52778c4dfc69f90a86c0440b20bd65edfe4cc Mon Sep 17 00:00:00 2001 From: rozetko Date: Fri, 30 Dec 2022 15:29:00 +0300 Subject: [PATCH] fix username --- src/routes/tasks.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/routes/tasks.ts b/src/routes/tasks.ts index 2061a6e..c8d782b 100644 --- a/src/routes/tasks.ts +++ b/src/routes/tasks.ts @@ -34,19 +34,14 @@ async function getTasks(req, res) { // TODO: read async let data = fs.readFileSync(path.join(EXPORTED_PATH, item), 'utf8'); let status = JSON.parse(data); - - let filename = ''; - if(status.status === 'finished') { - filename = file.name; - } resp.push({ timestamp: status.time, - username: status.user, + username: status.username, datasourceRef: status.datasourceRef, rowsCount: status.exportedRows, progress: status.progress, status: status.status, - filename, + filename: file.name, }); } @@ -85,7 +80,7 @@ async function addTask(req: TRequest, 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 jsonFilePath = path.join(EXPORTED_PATH, `${filename}.json`);