Skip to content

Commit 43f8bd2

Browse files
ersinkocclaude
andcommitted
🐛 fix(gateway): graceful fallback when expenses table doesn't exist yet
The /summary endpoint crashed with 'relation "expenses" does not exist' when migration 021 hasn't been run yet. Added .catch() fallbacks so the endpoint returns zero values for expenses instead of 500 error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ed9b26f commit 43f8bd2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/gateway/src/routes/personal-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ personalDataRoutes.get('/summary', async (c) => {
652652
contactsRepo.getUpcomingBirthdays(30),
653653
habitsRepo.getTodayProgress(),
654654
habitsRepo.list({ isArchived: false }),
655-
expensesRepo.getSummary(),
656-
expensesRepo.count(),
655+
expensesRepo.getSummary().catch(() => ({ totalAmount: 0, count: 0, byCategory: {}, byCurrency: {} })),
656+
expensesRepo.count().catch(() => 0),
657657
]);
658658

659659
const summary = {

0 commit comments

Comments
 (0)