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