mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
remove useless code
This commit is contained in:
@@ -68,12 +68,12 @@ function responseHandler() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
ctx.res.noContent = (params = {}) => {
|
// ctx.res.noContent = (params = {}) => {
|
||||||
ctx.res.success({
|
// ctx.res.success({
|
||||||
...params,
|
// ...params,
|
||||||
statusCode: statusCodes.NO_CONTENT,
|
// statusCode: statusCodes.NO_CONTENT,
|
||||||
});
|
// });
|
||||||
};
|
// };
|
||||||
|
|
||||||
// ctx.res.badRequest = (params = {}) => {
|
// ctx.res.badRequest = (params = {}) => {
|
||||||
// ctx.res.fail({
|
// ctx.res.fail({
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
module.exports = async (ctx, next) => {
|
module.exports = async (ctx, next) => {
|
||||||
await next();
|
await next();
|
||||||
if (ctx.request.path.startsWith('/api/')) {
|
if (ctx.request.path.startsWith('/api/')) {
|
||||||
if (ctx.body.counter > 0) {
|
return ctx.res.ok({
|
||||||
return ctx.res.ok({
|
message: `request returned ${ctx.body.counter} ${ctx.body.counter > 1 ? 'routes' : 'route'}`,
|
||||||
message: `request returned ${ctx.body.counter} ${ctx.body.counter > 1 ? 'routes' : 'route'}`,
|
data: ctx.body.result,
|
||||||
data: ctx.body.result,
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return ctx.res.noContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user