Enhance: Google Photos integration, refinement of Schedule/Todo lists and API fixes

This commit is contained in:
kihong.kim
2026-02-01 01:05:33 +09:00
parent c614c883d4
commit 5fa24d61c9
7 changed files with 56 additions and 40 deletions

View File

@@ -23,7 +23,18 @@ router.get("/", async (req, res) => {
router.get("/today", async (req, res) => {
try {
const { start, end } = getDayRange();
const todos = await Todo.find({ dueDate: { $gte: start, $lte: end } }).sort({
// Include:
// 1. Tasks due today
// 2. Overdue tasks (due before today) that are not completed
// 3. Tasks with no due date that are not completed
const todos = await Todo.find({
$or: [
{ dueDate: { $gte: start, $lte: end } },
{ dueDate: { $lt: start }, completed: false },
{ dueDate: { $exists: false }, completed: false },
{ dueDate: null, completed: false }
]
}).sort({
dueDate: 1,
createdAt: -1,
});