From 415cd55cf0f653a3adffe9315aba49f5b7bfc5ba Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Aug 2018 05:46:57 +0900 Subject: [PATCH] Fix bug --- src/server/api/endpoints/aggregation/notes.ts | 7 ++++--- src/server/api/endpoints/aggregation/users.ts | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/server/api/endpoints/aggregation/notes.ts b/src/server/api/endpoints/aggregation/notes.ts index 59dd46ae2..77ed07ef4 100644 --- a/src/server/api/endpoints/aggregation/notes.ts +++ b/src/server/api/endpoints/aggregation/notes.ts @@ -1,4 +1,3 @@ -import $ from 'cafy'; import Note from '../../../../models/note'; export const meta = { @@ -11,8 +10,10 @@ export const meta = { */ export default (params: any) => new Promise(async (res, rej) => { const query = [{ - createdAt: { - $gt: new Date(new Date().setFullYear(new Date().getFullYear() - 1)) + $match: { + createdAt: { + $gt: new Date(new Date().setFullYear(new Date().getFullYear() - 1)) + } } }, { $project: { diff --git a/src/server/api/endpoints/aggregation/users.ts b/src/server/api/endpoints/aggregation/users.ts index bb36fbfe4..d01648423 100644 --- a/src/server/api/endpoints/aggregation/users.ts +++ b/src/server/api/endpoints/aggregation/users.ts @@ -1,4 +1,3 @@ -import $ from 'cafy'; import User from '../../../../models/user'; export const meta = { @@ -11,8 +10,10 @@ export const meta = { */ export default (params: any) => new Promise(async (res, rej) => { const query = [{ - createdAt: { - $gt: new Date(new Date().setFullYear(new Date().getFullYear() - 1)) + $match: { + createdAt: { + $gt: new Date(new Date().setFullYear(new Date().getFullYear() - 1)) + } } }, { $project: {