whisper-money/resources/js/components/shared
Víctor Falcón aa3b811027
refactor(js): extract shared getCsrfToken util (#475)
## What

Same XSRF-TOKEN cookie-parsing snippet was duplicated inline in **12
files** (some as local `getCsrfToken()` copies, some inline
`decodeURIComponent(...)` blocks).

Extracted to single util: `resources/js/lib/csrf.ts`, with vitest
coverage.

## Why

Part of duplication-removal series — PRs that mostly delete code.

## Stats

- App code: **-89 / +23 lines**
- 12 files now import one shared util
- New: `lib/csrf.ts` (8 lines) + `lib/csrf.test.ts`

## Checks

- `bun run test` — 154 pass (3 new)
- `bun run lint` — clean (1 pre-existing warning in chart.tsx)
- `bun run format` — applied
- `tsc --noEmit` — 59 pre-existing errors on main, same 59 on branch
(none introduced)
2026-06-03 17:26:09 +02:00
..
category-combobox.tsx feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00
label-combobox-state.test.ts fix: prevent account label combobox crash (#230) 2026-03-16 13:03:11 +01:00
label-combobox-state.ts fix: prevent account label combobox crash (#230) 2026-03-16 13:03:11 +01:00
label-combobox.tsx refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00