mirror of
https://github.com/wassname/talk.git
synced 2026-09-11 12:51:33 +08:00
added user query by value to graph
This commit is contained in:
@@ -78,7 +78,7 @@ const RootQuery = {
|
||||
|
||||
// This endpoint is used for loading the user moderation queues (users whose username has been flagged),
|
||||
// so hide it in the event that we aren't an admin.
|
||||
async users(_, {query}, {user, loaders: {Users}}) {
|
||||
users(_, {query}, {user, loaders: {Users}}) {
|
||||
if (user == null || !user.can(SEARCH_OTHER_USERS)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ const User = {
|
||||
|
||||
return tokens;
|
||||
},
|
||||
async ignoredUsers({id}, args, {user, loaders: {Users}}) {
|
||||
ignoredUsers({id}, args, {user, loaders: {Users}}) {
|
||||
|
||||
// Only allow a logged in user that is either the current user or is a staff
|
||||
// member to access the ignoredUsers of a given user.
|
||||
@@ -63,8 +63,7 @@ const User = {
|
||||
return [];
|
||||
}
|
||||
|
||||
const connection = await Users.getByQuery({ids: user.ignoresUsers});
|
||||
return connection.nodes;
|
||||
return Users.getByID.loadMany(user.ignoresUsers);
|
||||
},
|
||||
role({id, role}, _, {user}) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user