Upgrade to Flow 0.71
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import Router from 'koa-router';
|
||||
import { Op } from 'sequelize';
|
||||
import Sequelize from 'sequelize';
|
||||
import auth from './middlewares/authentication';
|
||||
import pagination from './middlewares/pagination';
|
||||
import { presentDocument, presentRevision } from '../presenters';
|
||||
@ -9,6 +9,7 @@ import { InvalidRequestError } from '../errors';
|
||||
import events from '../events';
|
||||
import policy from '../policies';
|
||||
|
||||
const Op = Sequelize.Op;
|
||||
const { authorize } = policy;
|
||||
const router = new Router();
|
||||
|
||||
@ -50,6 +51,7 @@ router.post('documents.pinned', auth(), pagination(), async ctx => {
|
||||
teamId: user.teamId,
|
||||
atlasId: collection,
|
||||
pinnedById: {
|
||||
// $FlowFixMe
|
||||
[Op.ne]: null,
|
||||
},
|
||||
},
|
||||
@ -138,6 +140,7 @@ router.post('documents.drafts', auth(), pagination(), async ctx => {
|
||||
|
||||
const user = ctx.state.user;
|
||||
const documents = await Document.findAll({
|
||||
// $FlowFixMe
|
||||
where: { userId: user.id, publishedAt: { [Op.eq]: null } },
|
||||
order: [[sort, direction]],
|
||||
offset: ctx.state.pagination.offset,
|
||||
|
Reference in New Issue
Block a user