2021-10-18 13:08:12 +02:00
|
|
|
const { streamBackup } = require("../../utilities/fileSystem")
|
2021-01-27 14:55:46 +01:00
|
|
|
|
2021-05-03 09:31:09 +02:00
|
|
|
exports.exportAppDump = async function (ctx) {
|
2022-05-25 10:26:10 +02:00
|
|
|
let { appId, includeRows } = ctx.query
|
2021-10-18 13:08:12 +02:00
|
|
|
const appName = decodeURI(ctx.query.appname)
|
2022-05-25 10:26:10 +02:00
|
|
|
includeRows = includeRows === "true"
|
2021-10-18 13:08:12 +02:00
|
|
|
const backupIdentifier = `${appName}-export-${new Date().getTime()}.txt`
|
2021-01-29 22:52:45 +01:00
|
|
|
ctx.attachment(backupIdentifier)
|
2022-05-25 10:26:10 +02:00
|
|
|
|
|
|
|
ctx.body = await streamBackup(appId, includeRows)
|
2021-01-27 14:55:46 +01:00
|
|
|
}
|