- Add NoteCoUsage model and co-usage tracking when viewing notes - Add creationSource field to notes (form/quick/import) - Add dashboard metrics API (/api/metrics) - Add centrality calculation (/api/centrality) - Add feature flags system for toggling features - Add multiline QuickAdd with smart paste type detection - Add internal link suggestions while editing notes - Add type inference for automatic note type detection - Add comprehensive tests for type-inference and link-suggestions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
493 B
TypeScript
17 lines
493 B
TypeScript
import { NextRequest } from 'next/server'
|
|
import { getDashboardMetrics } from '@/lib/metrics'
|
|
import { createErrorResponse, createSuccessResponse } from '@/lib/errors'
|
|
|
|
export async function GET(req: NextRequest) {
|
|
try {
|
|
const { searchParams } = new URL(req.url)
|
|
const days = parseInt(searchParams.get('days') || '30', 10)
|
|
|
|
const metrics = await getDashboardMetrics(days)
|
|
|
|
return createSuccessResponse(metrics)
|
|
} catch (error) {
|
|
return createErrorResponse(error)
|
|
}
|
|
}
|