diff options
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/api/endpoints/aggregation/users/followers.ts | 4 | ||||
| -rw-r--r-- | src/server/api/endpoints/aggregation/users/following.ts | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/server/api/endpoints/aggregation/users/followers.ts b/src/server/api/endpoints/aggregation/users/followers.ts index 580d31a3f2..f9a5e8dca8 100644 --- a/src/server/api/endpoints/aggregation/users/followers.ts +++ b/src/server/api/endpoints/aggregation/users/followers.ts @@ -42,10 +42,10 @@ module.exports = (params) => new Promise(async (res, rej) => { for (let i = 0; i < 30; i++) { graph.push(FollowedLog.findOne({ - _id: { $lt: ObjectID.createFromTime(cursorTime / 1000) }, + createdAt: { $lt: new Date(cursorTime / 1000) }, userId: user._id }, { - sort: { _id: -1 }, + sort: { createdAt: -1 }, }).then(log => { cursorDate = new Date(today.getTime()); cursorTime = cursorDate.setDate(today.getDate() - i); diff --git a/src/server/api/endpoints/aggregation/users/following.ts b/src/server/api/endpoints/aggregation/users/following.ts index 3ac0e3a539..b30b1282ba 100644 --- a/src/server/api/endpoints/aggregation/users/following.ts +++ b/src/server/api/endpoints/aggregation/users/following.ts @@ -42,10 +42,10 @@ module.exports = (params) => new Promise(async (res, rej) => { for (let i = 0; i < 30; i++) { graph.push(FollowingLog.findOne({ - _id: { $lt: ObjectID.createFromTime(cursorTime / 1000) }, + createdAt: { $lt: new Date(cursorTime / 1000) }, userId: user._id }, { - sort: { _id: -1 }, + sort: { createdAt: -1 }, }).then(log => { cursorDate = new Date(today.getTime()); cursorTime = cursorDate.setDate(today.getDate() - i); |