mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
add a drawer for the user details
This commit is contained in:
@@ -10,6 +10,13 @@ const User = {
|
||||
}
|
||||
|
||||
},
|
||||
created_at({roles, created_at}, _, {user}) {
|
||||
if (user && user.hasRoles('ADMIN')) {
|
||||
return created_at;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
comments({id}, _, {loaders: {Comments}, user}) {
|
||||
|
||||
// If the user is not an admin, only return comment list for the owner of
|
||||
@@ -20,10 +27,10 @@ const User = {
|
||||
|
||||
return null;
|
||||
},
|
||||
profiles({id, profiles}, _, {user}) {
|
||||
profiles({profiles}, _, {user}) {
|
||||
|
||||
// if the user is not an admin, do not return the profiles
|
||||
if (user && (user.hasRoles('ADMIN') || user.id === id)) {
|
||||
if (user && user.hasRoles('ADMIN')) {
|
||||
return profiles;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,9 @@ type User {
|
||||
# Username of a user.
|
||||
username: String!
|
||||
|
||||
# creation date of user
|
||||
created_at: String!
|
||||
|
||||
# Action summaries against the user.
|
||||
action_summaries: [ActionSummary]!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user