Update:Backups API endpoints, add get all backups route, update socket init event payload

This commit is contained in:
advplyr 2022-11-24 13:14:29 -06:00
parent 6af5ac2be1
commit 64a8a046c1
7 changed files with 67 additions and 50 deletions

View file

@ -106,13 +106,20 @@ class BackupManager {
this.backups.push(backup)
}
return res.json(this.backups.map(b => b.toJSON()))
res.json({
backups: this.backups.map(b => b.toJSON())
})
}
async requestCreateBackup(res) {
var backupSuccess = await this.runBackup()
if (backupSuccess) res.json(this.backups.map(b => b.toJSON()))
else res.sendStatus(500)
if (backupSuccess) {
res.json({
backups: this.backups.map(b => b.toJSON())
})
} else {
res.sendStatus(500)
}
}
async requestApplyBackup(backup) {