Delete team start times, fix download link style, fix download file name
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import passport from "passport"
|
||||
import createError from "http-errors"
|
||||
import autobind from "autobind-decorator"
|
||||
import { catchAll } from "."
|
||||
import { catchAll, TeamRoutes } from "."
|
||||
|
||||
@autobind
|
||||
export class ActivityRoutes {
|
||||
@@ -166,8 +166,10 @@ export class ActivityRoutes {
|
||||
|
||||
async deleteAllActivities(req, res, next) {
|
||||
const Activity = this.db.Activity
|
||||
const Team = this.db.Team
|
||||
|
||||
await Activity.remove({})
|
||||
await Team.updateMany({}, { $set: { start: null } })
|
||||
|
||||
res.json({})
|
||||
}
|
||||
|
||||
@@ -179,6 +179,7 @@ export class TeamRoutes {
|
||||
|
||||
res.writeHead(200, {
|
||||
"Content-Type": "application/gzip",
|
||||
"Content-Disposition": 'attachment; filename="team-scores.gzip"',
|
||||
})
|
||||
readable.pipe(gzip).pipe(res)
|
||||
}
|
||||
|
||||
@@ -204,6 +204,7 @@ export class WorkItemRoutes {
|
||||
const WorkItem = this.db.WorkItem
|
||||
|
||||
await Activity.remove({})
|
||||
await Team.updateMany({}, { $set: { start: null } })
|
||||
await WorkItem.remove({})
|
||||
|
||||
res.json({})
|
||||
|
||||
Reference in New Issue
Block a user