chore: Move to prettier standard double quotes (#1309)
This commit is contained in:
@ -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,
|
||||
});
|
||||
|
Reference in New Issue
Block a user