Add gzipped download endpoint

This commit is contained in:
John Lyon-Smith
2018-04-26 18:00:16 -07:00
parent 5e5daa2e78
commit 96e2599cdb
9 changed files with 390 additions and 164 deletions

View File

@@ -45,6 +45,13 @@ export class WorkItemRoutes {
passport.authenticate("bearer", { session: false }),
catchAll(this.deleteWorkItem)
)
app
.route("/workitems/all")
.delete(
passport.authenticate("bearer", { session: false }),
catchAll(this.deleteAllWorkItems)
)
}
async listWorkItems(req, res, next) {
@@ -189,4 +196,14 @@ export class WorkItemRoutes {
res.json({})
}
async deleteAllWorkItems(req, res, next) {
const Activity = this.db.Activity
const WorkItem = this.db.WorkItem
await Activity.remove({})
await WorkItem.remove({})
res.json({})
}
}