Delete team start times, fix download link style, fix download file name

This commit is contained in:
John Lyon-Smith
2018-04-29 12:12:03 -07:00
parent a3f96bbb6c
commit 16006e933e
4 changed files with 7 additions and 3 deletions

View File

@@ -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({})
}

View File

@@ -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)
}

View File

@@ -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({})