feat(frontend): Implement Phase 1 - ProjectManagement API Client & Hooks
Add complete API integration for ProjectManagement module: - Epics, Stories, Tasks API clients - React Query hooks for all entities - Updated type definitions to match backend API - API test page for connection verification Changes: - Update lib/api/config.ts: Add all ProjectManagement endpoints - Update types/project.ts: Match backend API models (Epic, Story, Task) - Create lib/api/pm.ts: API clients for Epics, Stories, Tasks - Create lib/hooks/use-epics.ts: React Query hooks for Epic CRUD - Create lib/hooks/use-stories.ts: React Query hooks for Story CRUD - Create lib/hooks/use-tasks.ts: React Query hooks for Task CRUD - Create app/(dashboard)/api-test/page.tsx: API connection test page Features: - Full CRUD operations for Epics, Stories, Tasks - Status change and assignment operations - Optimistic updates for better UX - Error handling with toast notifications - Query invalidation for cache consistency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5000';
|
||||
export const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:5167';
|
||||
|
||||
export const API_ENDPOINTS = {
|
||||
// Auth
|
||||
@@ -17,7 +17,25 @@ export const API_ENDPOINTS = {
|
||||
ASSIGN_ROLE: (tenantId: string, userId: string) =>
|
||||
`/api/tenants/${tenantId}/users/${userId}/role`,
|
||||
|
||||
// Projects (to be implemented)
|
||||
PROJECTS: '/api/projects',
|
||||
PROJECT: (id: string) => `/api/projects/${id}`,
|
||||
// Projects
|
||||
PROJECTS: '/api/v1/projects',
|
||||
PROJECT: (id: string) => `/api/v1/projects/${id}`,
|
||||
|
||||
// Epics
|
||||
EPICS: '/api/v1/epics',
|
||||
EPIC: (id: string) => `/api/v1/epics/${id}`,
|
||||
EPIC_STATUS: (id: string) => `/api/v1/epics/${id}/status`,
|
||||
EPIC_ASSIGN: (id: string) => `/api/v1/epics/${id}/assign`,
|
||||
|
||||
// Stories
|
||||
STORIES: '/api/v1/stories',
|
||||
STORY: (id: string) => `/api/v1/stories/${id}`,
|
||||
STORY_STATUS: (id: string) => `/api/v1/stories/${id}/status`,
|
||||
STORY_ASSIGN: (id: string) => `/api/v1/stories/${id}/assign`,
|
||||
|
||||
// Tasks
|
||||
TASKS: '/api/v1/tasks',
|
||||
TASK: (id: string) => `/api/v1/tasks/${id}`,
|
||||
TASK_STATUS: (id: string) => `/api/v1/tasks/${id}/status`,
|
||||
TASK_ASSIGN: (id: string) => `/api/v1/tasks/${id}/assign`,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user