mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 08:11:08 -05:00
726 B
726 B
Park Detail API Implementation
Overview
Implementing the park detail API endpoint at /api/parks/[slug] to provide detailed information about a specific park.
Implementation Details
- Route:
/api/parks/[slug]/route.ts - Response Type:
ParkDetailResponse(already defined in api.ts) - Error Handling:
- 404 for invalid park slugs
- 500 for server/database errors
Data Structure
Reusing existing Park type with full relationships:
- Basic park info (name, description, etc.)
- Areas
- Reviews with user info
- Photos with user info
- Creator details
- Owner (company) details
Date Formatting
Following established pattern:
- Split ISO dates at 'T' for date-only fields
- Full ISO string for timestamps