- Zod validation schemas for create/update project - Service layer with listProjects, getProject, createProject, updateProject, deleteProject - API routes: GET/POST /api/projects, GET/PATCH/DELETE /api/projects/:id - TanStack Query hooks for all project operations - Project list page with card grid, status/priority badges - Project create dialog with form validation - QueryProvider + API utility helpers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
22 lines
527 B
TypeScript
22 lines
527 B
TypeScript
"use client";
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { useState } from "react";
|
|
|
|
export function QueryProvider({ children }: { children: React.ReactNode }) {
|
|
const [queryClient] = useState(
|
|
() =>
|
|
new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 60 * 1000,
|
|
refetchOnWindowFocus: false,
|
|
},
|
|
},
|
|
})
|
|
);
|
|
|
|
return (
|
|
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
|
);
|
|
}
|