mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
fix: fix document count in admin search
This commit is contained in:
@@ -129,7 +129,7 @@ router.get("/repos", async (req, res) => {
|
||||
page,
|
||||
total: await AnonymizedRepositoryModel.find({
|
||||
$and: query,
|
||||
}).estimatedDocumentCount(),
|
||||
}).countDocuments(),
|
||||
sort,
|
||||
results: await AnonymizedRepositoryModel.find({ $and: query })
|
||||
.sort(sort)
|
||||
@@ -156,7 +156,7 @@ router.get("/users", async (req, res) => {
|
||||
res.json({
|
||||
query: query,
|
||||
page,
|
||||
total: await UserModel.find(query).estimatedDocumentCount(),
|
||||
total: await UserModel.find(query).countDocuments(),
|
||||
sort,
|
||||
results: await UserModel.find(query)
|
||||
.sort(sort)
|
||||
|
||||
Reference in New Issue
Block a user