diff options
| author | diogo464 <[email protected]> | 2025-08-14 15:13:01 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-14 15:13:01 +0100 |
| commit | ba1d991f6a42941f2bf0ea08c937a6f07a8093e4 (patch) | |
| tree | 384e53eaf7a398a4d475a66bdaf343c357c5f758 /frontend | |
| parent | 6b0aa089624fdce5521670ba460a1f8870b1bb4f (diff) | |
fix: update searchParams interface for Next.js 15 compatibility
- Change searchParams from object to Promise<object> in HistoryPageProps
- Await searchParams resolution in HistoryPage component
- Fixes TypeScript compilation error during build process
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/app/history/page.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/frontend/app/history/page.tsx b/frontend/app/history/page.tsx index 9ccba27..7af0a9e 100644 --- a/frontend/app/history/page.tsx +++ b/frontend/app/history/page.tsx | |||
| @@ -2,14 +2,15 @@ import { Drive_log } from "@/lib/drive_server" | |||
| 2 | import { HistoryView } from "@/components/history/HistoryView" | 2 | import { HistoryView } from "@/components/history/HistoryView" |
| 3 | 3 | ||
| 4 | interface HistoryPageProps { | 4 | interface HistoryPageProps { |
| 5 | searchParams: { [key: string]: string | string[] | undefined } | 5 | searchParams: Promise<{ [key: string]: string | string[] | undefined }> |
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | export default async function HistoryPage({ searchParams }: HistoryPageProps) { | 8 | export default async function HistoryPage({ searchParams }: HistoryPageProps) { |
| 9 | const logEntries = await Drive_log() | 9 | const logEntries = await Drive_log() |
| 10 | const resolvedSearchParams = await searchParams | ||
| 10 | 11 | ||
| 11 | // Parse page parameter (default to 0) | 12 | // Parse page parameter (default to 0) |
| 12 | const page = parseInt((searchParams.page as string) || '0', 10) | 13 | const page = parseInt((resolvedSearchParams.page as string) || '0', 10) |
| 13 | const pageSize = 50 | 14 | const pageSize = 50 |
| 14 | 15 | ||
| 15 | // Sort by timestamp descending (most recent first) | 16 | // Sort by timestamp descending (most recent first) |
