Skip to content

v0.5.0

Choose a tag to compare

@JoaoHenriqueBarbosa JoaoHenriqueBarbosa released this 28 Feb 19:04
· 64 commits to main since this release
07cd73b

TanStack Form + TanStack Table across admin CRUD pages

New dependencies

  • @tanstack/react-form v1.28.3
  • @tanstack/react-table v8.21.3

New files

File Purpose
src/hooks/use-crud-mutation.ts Generic mutation hook — invalidation, toasts, fully typed callbacks
src/components/ui/data-table.tsx DataTable<T> — TanStack Table with sorting, responsive column hiding, CSV export, afterRows slot
src/components/ui/search-filter.tsx Search input + colored filter buttons

Changes

  • TanStack Form with Zod validation replaces manual useState forms on all 5 admin CRUD pages
  • DataTable<T> replaces manual <Table> rendering — 3-way sort toggle, mobile column hiding, timestamped CSV export
  • useCrudMutation eliminates repetitive useMutation + invalidateQueries + toast boilerplate
  • SearchFilter replaces repeated search + dropdown filter patterns
  • Input extended with optional label and error props (backward-compatible)

Refactored pages

  • products — form, table, mutations, search/filter, CSV export
  • customers — same
  • orders — edit+delete only, no create
  • payment-methods — simple CRUD
  • cashier — DataTable with afterRows for inline form, edit dialog with useForm

Fixes

  • useCrudMutation now correctly invalidates tRPC queries after create (#17)