|
|
|
@ -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`); |
|
|
|
|
|
|
|
|
|