fix: move SQL query from route handler to SessionStore for better separation of concerns
Extracted SQL query from handleSessionInit route handler into SessionStore.getLatestUserPrompt() method to fix abstraction leak and improve type safety. Changes: - Added getLatestUserPrompt() method to SessionStore with proper return type - Replaced raw SQL query in SessionRoutes with type-safe method call - Removed direct database access through dbManager.getSessionStore().db - Improved separation of concerns (data layer vs HTTP layer) Benefits: - Type safety: Explicit return type instead of 'as any' cast - Maintainability: SQL query logic belongs in data layer - Testability: Can test query logic independently from HTTP layer - Consistency: Follows existing pattern of query methods in SessionStore Phase 3 Complete: SQL abstraction leak fixed in session init endpoint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user