mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Adding statuses
This commit is contained in:
@@ -115,7 +115,7 @@ const getUsersByQuery = async ({user, loaders: {Actions}}, {ids, limit, cursor,
|
||||
* @return {Promise} resolves to the counts of the users from the
|
||||
* query
|
||||
*/
|
||||
const getCountByQuery = async ({loaders: {Actions}}, {action_type}) => {
|
||||
const getCountByQuery = async ({loaders: {Actions}}, {action_type, statuses}) => {
|
||||
let query = UserModel.find();
|
||||
|
||||
if (action_type) {
|
||||
@@ -128,6 +128,14 @@ const getCountByQuery = async ({loaders: {Actions}}, {action_type}) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (statuses) {
|
||||
query = query.where({
|
||||
status: {
|
||||
$in: statuses
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return UserModel
|
||||
.find(query)
|
||||
.count();
|
||||
|
||||
@@ -348,6 +348,9 @@ input UserCountQuery {
|
||||
# comments returned will only be ones which have at least one action of this
|
||||
# type.
|
||||
action_type: ACTION_TYPE
|
||||
|
||||
# Current status of a user.
|
||||
statuses: [USER_STATUS]
|
||||
}
|
||||
|
||||
type EditInfo {
|
||||
|
||||
Reference in New Issue
Block a user