Lint rules and flow annotations for rest of the files
This commit is contained in:
@ -1,8 +1,14 @@
|
||||
// @flow
|
||||
import queryString from 'query-string';
|
||||
import { type Context } from 'koa';
|
||||
|
||||
export default function methodOverride(_options) {
|
||||
return async function methodOverrideMiddleware(ctx, next) {
|
||||
export default function methodOverride() {
|
||||
return async function methodOverrideMiddleware(
|
||||
ctx: Context,
|
||||
next: () => Promise<void>
|
||||
) {
|
||||
if (ctx.method === 'POST') {
|
||||
// $FlowFixMe
|
||||
ctx.body = ctx.request.body;
|
||||
} else if (ctx.method === 'GET') {
|
||||
ctx.method = 'POST'; // eslint-disable-line
|
||||
|
Reference in New Issue
Block a user