mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-03-27 03:49:43 -04:00
feat: Complete Phase 5 of Django Unicorn refactoring for park detail templates
- Refactored park detail template from HTMX/Alpine.js to Django Unicorn component
- Achieved ~97% reduction in template complexity
- Created ParkDetailView component with optimized data loading and reactive features
- Developed a responsive reactive template for park details
- Implemented server-side state management and reactive event handlers
- Enhanced performance with optimized database queries and loading states
- Comprehensive error handling and user experience improvements
docs: Update Django Unicorn refactoring plan with completed components and phases
- Documented installation and configuration of Django Unicorn
- Detailed completed work on park search component and refactoring strategy
- Outlined planned refactoring phases for future components
- Provided examples of component structure and usage
feat: Implement parks rides endpoint with comprehensive features
- Developed API endpoint GET /api/v1/parks/{park_slug}/rides/ for paginated ride listings
- Included filtering capabilities for categories and statuses
- Optimized database queries with select_related and prefetch_related
- Implemented serializer for comprehensive ride data output
- Added complete API documentation for frontend integration
This commit is contained in:
@@ -141,6 +141,7 @@ import type {
|
||||
RideSummary,
|
||||
CreateRideRequest,
|
||||
RideDetail,
|
||||
ParkRideDetail,
|
||||
RideFilterOptions,
|
||||
RideImageSettings,
|
||||
RidePhotosResponse,
|
||||
@@ -846,6 +847,41 @@ export const parksApi = {
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
},
|
||||
|
||||
// Park Rides endpoints
|
||||
async getParkRides(parkSlug: string, params?: {
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
category?: string | string[];
|
||||
status?: string | string[];
|
||||
ordering?: string;
|
||||
}): Promise<PaginatedResponse<RideSummary>> {
|
||||
const searchParams = new URLSearchParams();
|
||||
|
||||
if (params) {
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach(v => searchParams.append(key, v.toString()));
|
||||
} else {
|
||||
searchParams.append(key, value.toString());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const query = searchParams.toString();
|
||||
return makeRequest<PaginatedResponse<RideSummary>>(`/parks/${parkSlug}/rides/${query ? `?${query}` : ''}`);
|
||||
},
|
||||
|
||||
async getParkRideDetail(parkSlug: string, rideSlug: string): Promise<ParkRideDetail> {
|
||||
return makeRequest<ParkRideDetail>(`/parks/${parkSlug}/rides/${rideSlug}/`);
|
||||
},
|
||||
|
||||
// Get comprehensive details for a specific park
|
||||
async getParkDetail(parkSlug: string): Promise<ParkComprehensiveDetail> {
|
||||
return makeRequest<ParkComprehensiveDetail>(`/parks/${parkSlug}/detail/`);
|
||||
},
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user