summaryrefslogtreecommitdiff
path: root/src/api/endpoints/aggregation/users.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-28 16:39:14 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-28 16:39:14 +0900
commit3d5cdb8d2d60932caf1d29b0581c7d6243e06e37 (patch)
tree9c29d1062b08378d4c4cafe5976793616d45bc01 /src/api/endpoints/aggregation/users.ts
parentwip (diff)
downloadsharkey-3d5cdb8d2d60932caf1d29b0581c7d6243e06e37.tar.gz
sharkey-3d5cdb8d2d60932caf1d29b0581c7d6243e06e37.tar.bz2
sharkey-3d5cdb8d2d60932caf1d29b0581c7d6243e06e37.zip
wip
Diffstat (limited to 'src/api/endpoints/aggregation/users.ts')
-rw-r--r--src/api/endpoints/aggregation/users.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/endpoints/aggregation/users.ts b/src/api/endpoints/aggregation/users.ts
index e38ce92ff9..a4e91a2282 100644
--- a/src/api/endpoints/aggregation/users.ts
+++ b/src/api/endpoints/aggregation/users.ts
@@ -22,8 +22,8 @@ module.exports = params => new Promise(async (res, rej) => {
},
fields: {
_id: false,
- created_at: true,
- deleted_at: true
+ createdAt: true,
+ deletedAt: true
}
});
@@ -44,11 +44,11 @@ module.exports = params => new Promise(async (res, rej) => {
// day = day.getTime();
const total = users.filter(u =>
- u.created_at < dayEnd && (u.deleted_at == null || u.deleted_at > dayEnd)
+ u.createdAt < dayEnd && (u.deletedAt == null || u.deletedAt > dayEnd)
).length;
const created = users.filter(u =>
- u.created_at < dayEnd && u.created_at > dayStart
+ u.createdAt < dayEnd && u.createdAt > dayStart
).length;
graph.push({