chore: remove POST /api/notifications (superseded by /api/emails)
Merged
SW
4mo ago+1+1+0123456789-599-599-012345678901234567890123456789
Deletes the POST /api/notifications route as part of the chat#1815 cleanup. Implements the merged-path contract removal in docs#253.
Why
/api/notifications emailed only the account's own address. With to now optional on POST /api/emails (defaulting to the account's own email — api#710), /api/emails fully subsumes it. Keeping both is dead surface area.
What changed (deletion + one comment fix)
- Deleted
app/api/notifications/route.ts. - Deleted
lib/notifications/*—createNotificationHandler.ts,validateCreateNotificationBody.ts, and both tests (598 deletions). - Kept
lib/emails/processAndSendEmail.ts(still the shared domain fn for thesend_emailMCP tool) and updated its stale JSDoc:POST /api/notifications handler→POST /api/emails handler.
Verification
grep -rn "api/notifications\|createNotification\|CreateNotification\|NotificationResponse\|lib/notifications"acrossapi(excl..next/node_modules) → clean.pnpm exec vitest run lib/emails→ 126 passed (processAndSendEmail+send_emailpaths unaffected).
Dependencies / sequencing
- Sibling: recoupable/cli re-points its
notificationscommand from/api/notifications→/api/emails(self-send). That CLI PR should merge before/with this so the command keeps working. - Contract: docs#253.
- Lands before close of chat#1815, after
/api/emailsto-optional (api#710) is live.
🤖 Generated with Claude Code
Summary by cubic
Removed the POST /api/notifications endpoint and consolidated email sending on POST /api/emails, which defaults to the account email when to is omitted. Part of chat#1815 cleanup; aligns with docs#253 and api#710.
-
Refactors
- Deleted
app/api/notifications/route.tsandlib/notifications/*(handler, validator, tests). - Kept
lib/emails/processAndSendEmail.ts; JSDoc now references/api/emailsand thesend_emailMCP tool.
- Deleted
-
Migration
- Update clients from POST
/api/notificationsto POST/api/emails; omittoto self-send. - Ensure the CLI notifications command targets
/api/emails; merge alongside this change.
- Update clients from POST