archive: implement unarchive

made a separate route instead of reusing install route. this was
because we want to copy over all the old app config as much as
possible.
This commit is contained in:
Girish Ramakrishnan
2024-12-10 14:46:30 +01:00
parent e168be6d97
commit 0e181cdc82
9 changed files with 173 additions and 90 deletions
+5 -4
View File
@@ -162,10 +162,11 @@ async function initializeExpressSync() {
router.post('/api/v1/backups/:backupId', json, token, authorizeAdmin, routes.backups.update);
// app archive routes
router.get ('/api/v1/archives', token, authorizeAdmin, routes.archives.list);
router.get ('/api/v1/archives/:id', token, authorizeAdmin, routes.archives.load, routes.archives.get);
router.del ('/api/v1/archives/:id', token, authorizeAdmin, routes.archives.load, routes.archives.del);
router.get ('/api/v1/archives/:id/icon', routes.archives.load, routes.archives.getIcon);
router.get ('/api/v1/archives', token, authorizeAdmin, routes.archives.list);
router.get ('/api/v1/archives/:id', token, authorizeAdmin, routes.archives.load, routes.archives.get);
router.del ('/api/v1/archives/:id', token, authorizeAdmin, routes.archives.load, routes.archives.del);
router.post('/api/v1/archives/:id/unarchive', json, token, authorizeAdmin, routes.archives.load, routes.archives.unarchive);
router.get ('/api/v1/archives/:id/icon', routes.archives.load, routes.archives.getIcon);
// working off the user behind the provided token
router.get ('/api/v1/profile', token, authorizeUser, routes.profile.get);