Skip to content

Commit 1d7e324

Browse files
committed
userShema modified with property isAdmin
1 parent 3f894cd commit 1d7e324

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

controllers/personal.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ module.exports = {
9191
code: user.mobile.code,
9292
number: user.mobile.number,
9393
},
94+
isAdmin: user.isAdmin,
9495
},
9596
};
9697
ctx.response.status = 200;
@@ -137,6 +138,7 @@ module.exports = {
137138
code: user.mobile.code,
138139
number: user.mobile.number,
139140
},
141+
isAdmin: user.isAdmin,
140142
},
141143
};
142144
ctx.response.status = 200;

models/User.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const UserSchema = new User({
6262
rating: {
6363
type: Number,
6464
},
65-
isAdmin: false,
65+
isAdmin: {
66+
type: Boolean,
67+
default: false,
68+
},
6669
token: String,
6770
passwordHash: String,
6871
salt: String,

0 commit comments

Comments
 (0)