backups: move mount status to separate route

This commit is contained in:
Girish Ramakrishnan
2023-04-30 17:21:18 +02:00
parent 898413bfd4
commit 883915c9d3
7 changed files with 42 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ exports = module.exports = {
create,
cleanup,
remount,
getMountStatus
};
const assert = require('assert'),
@@ -63,3 +64,9 @@ async function remount(req, res, next) {
next(new HttpSuccess(202, {}));
}
async function getMountStatus(req, res, next) {
const [error, mountStatus] = await safe(backups.getMountStatus());
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, mountStatus));
}