feat: admin dashboard last logins

This commit is contained in:
NGPixel
2020-04-13 15:54:10 -04:00
committed by Nicolas Giard
parent 514d31a46d
commit 9a93ac28f2
5 changed files with 75 additions and 43 deletions

View File

@@ -46,6 +46,13 @@ module.exports = {
usr.tfaSecret = ''
return usr
},
async lastLogins (obj, args, context, info) {
return WIKI.models.users.query()
.select('id', 'name', 'lastLoginAt')
.whereNotNull('lastLoginAt')
.orderBy('lastLoginAt', 'desc')
.limit(10)
}
},
UserMutation: {