Separated GET and POST calls

This commit is contained in:
Jori Lallo
2016-07-23 12:09:50 -07:00
parent 885a1a0953
commit 71f68a8af4
6 changed files with 11 additions and 7 deletions

View File

@ -4,7 +4,7 @@ export default function methodOverride(options) {
return async function methodOverrideMiddleware(ctx, next) {
if (ctx.method === 'POST') {
ctx.body = ctx.request.body;
} else {
} else if (ctx.method === 'GET') {
ctx.method= 'POST';
ctx.body = queryString.parse(ctx.querystring);
}