chore: Move to prettier standard double quotes (#1309)

This commit is contained in:
Tom Moor
2020-06-20 13:59:15 -07:00
committed by GitHub
parent 2a3b9e2104
commit f43deb7940
444 changed files with 5988 additions and 5977 deletions

View File

@ -1,22 +1,22 @@
// @flow
import debug from 'debug';
import Router from 'koa-router';
import subDays from 'date-fns/sub_days';
import { AuthenticationError } from '../errors';
import { Document, Attachment } from '../models';
import { Op } from '../sequelize';
import debug from "debug";
import Router from "koa-router";
import subDays from "date-fns/sub_days";
import { AuthenticationError } from "../errors";
import { Document, Attachment } from "../models";
import { Op } from "../sequelize";
const router = new Router();
const log = debug('utils');
const log = debug("utils");
router.post('utils.gc', async ctx => {
router.post("utils.gc", async ctx => {
const { token } = ctx.body;
if (process.env.UTILS_SECRET !== token) {
throw new AuthenticationError('Invalid secret token');
throw new AuthenticationError("Invalid secret token");
}
log('Permanently deleting documents older than 30 days…');
log("Permanently deleting documents older than 30 days…");
const where = {
deletedAt: {
@ -24,8 +24,8 @@ router.post('utils.gc', async ctx => {
},
};
const documents = await Document.scope('withUnpublished').findAll({
attributes: ['id'],
const documents = await Document.scope("withUnpublished").findAll({
attributes: ["id"],
where,
});
const documentIds = documents.map(d => d.id);
@ -36,7 +36,7 @@ router.post('utils.gc', async ctx => {
},
});
await Document.scope('withUnpublished').destroy({
await Document.scope("withUnpublished").destroy({
where,
force: true,
});