aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/server/routes/study.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/routes/study.ts')
-rw-r--r--src/server/routes/study.ts15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/server/routes/study.ts b/src/server/routes/study.ts
index d05f3ca..0f42f93 100644
--- a/src/server/routes/study.ts
+++ b/src/server/routes/study.ts
@@ -52,20 +52,9 @@ export function createStudyRouter(deps: StudyDependencies) {
const now = new Date();
- // Calculate new card budget based on today's already-reviewed new cards
- const reviewedNewCards = await reviewLogRepo.countTodayNewCardReviews(
- deckId,
- now,
- );
- const newCardBudget = Math.max(0, deck.newCardsPerDay - reviewedNewCards);
+ const cards = await cardRepo.findDueCardsForStudy(deckId, now);
- // Fetch new cards (limited) and review cards separately
- const [newCards, reviewCards] = await Promise.all([
- cardRepo.findDueNewCardsForStudy(deckId, now, newCardBudget),
- cardRepo.findDueReviewCardsForStudy(deckId, now, 80),
- ]);
-
- return c.json({ cards: [...newCards, ...reviewCards] }, 200);
+ return c.json({ cards }, 200);
})
.post(
"/:cardId",