diff --git a/src/server/api/routers/subject.ts b/src/server/api/routers/subject.ts index b0967e7..d0a7cf1 100644 --- a/src/server/api/routers/subject.ts +++ b/src/server/api/routers/subject.ts @@ -21,8 +21,8 @@ export const subjectRouter = createTRPCRouter({ .leftJoin(favorites, eq(favorites.questionId, questions.id)) .where( and( - gt(questions.createdAt, dayjs().subtract(7, 'days').toDate()), - gt(answers.createdAt, dayjs().subtract(7, 'days').toDate()), + gt(questions.createdAt, dayjs().subtract(6, 'months').toDate()), + gt(answers.createdAt, dayjs().subtract(6, 'months').toDate()), ), ) .orderBy(desc(score)) diff --git a/src/server/api/routers/user.ts b/src/server/api/routers/user.ts index 0654dc9..ba29fa9 100644 --- a/src/server/api/routers/user.ts +++ b/src/server/api/routers/user.ts @@ -197,8 +197,8 @@ export const userRouter = createTRPCRouter({ .leftJoin(favorites, eq(favorites.userId, users.id)) .where( and( - gt(questions.createdAt, dayjs().subtract(7, 'days').toDate()), - gt(answers.createdAt, dayjs().subtract(7, 'days').toDate()), + gt(questions.createdAt, dayjs().subtract(6, 'months').toDate()), + gt(answers.createdAt, dayjs().subtract(6, 'months').toDate()), ), ) .groupBy(users.id) diff --git a/src/server/repositories/postgres/question-repo-pg.ts b/src/server/repositories/postgres/question-repo-pg.ts index d097c49..3e3cf7f 100644 --- a/src/server/repositories/postgres/question-repo-pg.ts +++ b/src/server/repositories/postgres/question-repo-pg.ts @@ -298,9 +298,9 @@ class QuestionRepoPg { subjectId ? and( eq(questions.subjectId, subjectId), - gt(questions.createdAt, dayjs().subtract(7, 'days').toDate()), + gt(questions.createdAt, dayjs().subtract(6, 'months').toDate()), ) - : gt(questions.createdAt, dayjs().subtract(7, 'days').toDate()), + : gt(questions.createdAt, dayjs().subtract(6, 'months').toDate()), ) .orderBy(desc(popularity)) .groupBy(