Switched to ok from success on API responses

This commit is contained in:
Jori Lallo
2016-09-11 15:48:03 -07:00
parent b03d6aa116
commit 60e9a700de
4 changed files with 9 additions and 10 deletions

View File

@ -1,13 +1,13 @@
import queryString from 'query-string';
export default function methodOverride(options) {
export default function methodOverride(_options) {
return async function methodOverrideMiddleware(ctx, next) {
if (ctx.method === 'POST') {
ctx.body = ctx.request.body;
} else if (ctx.method === 'GET') {
ctx.method= 'POST';
ctx.method= 'POST'; // eslint-disable-line
ctx.body = queryString.parse(ctx.querystring);
}
return next();
}
};
};
}