Skip to content

Commit

Permalink
import middleware by fileName
Browse files Browse the repository at this point in the history
  • Loading branch information
fengkx committed Dec 23, 2018
1 parent 743586a commit 2604974
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
Empty file added middlewares/index.js
Empty file.
5 changes: 1 addition & 4 deletions middlewares/permission.js → middlewares/isAdmin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const pm = {};

pm.isAdmin = async (ctx, next) => {
module.exports = async (ctx, next) => {
ctx.state.chat = await ctx.getChat();
const chat = ctx.state.chat;
if (chat.type !== 'private') {
Expand All @@ -19,4 +17,3 @@ pm.isAdmin = async (ctx, next) => {
await next();
};

module.exports = pm;

0 comments on commit 2604974

Please sign in to comment.