whisper-money/resources/js/components/transactions
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
..
bulk-actions-bar.tsx
…
bulk-category-select.tsx
…
bulk-label-select.tsx
…
categorizer-card.tsx feat(categorize): show debtor and creditor names (#454) 2026-05-30 12:27:59 +02:00
categorizer-command.tsx
…
category-cell.tsx
…
category-select.tsx
…
edit-transaction-dialog.test.tsx feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
edit-transaction-dialog.tsx refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00
encrypted-transaction-description.tsx
…
import-step-account.test.tsx Fix transaction importer account preselect (#396) 2026-05-14 12:38:44 +02:00
import-step-account.tsx Fix transaction importer account preselect (#396) 2026-05-14 12:38:44 +02:00
import-step-mapping.tsx feat(importer): support YYYYMMDD date format (#470) 2026-06-01 16:44:46 +02:00
import-step-preview.tsx feat(import): calculate balances from transactions (#403) 2026-05-20 10:29:14 +01:00
import-step-upload.test.tsx Fix transaction importer account preselect (#396) 2026-05-14 12:38:44 +02:00
import-step-upload.tsx Fix transaction importer account preselect (#396) 2026-05-14 12:38:44 +02:00
import-transactions-button.tsx
…
import-transactions-drawer.tsx refactor(js): extract shared getCsrfToken util (#475) 2026-06-03 17:26:09 +02:00
transaction-actions-menu.tsx
…
transaction-columns.tsx feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
transaction-filters.tsx feat(transactions): add counterparty fields (#440) 2026-05-27 16:20:55 +02:00
transaction-list.tsx feat(budgets): track multiple categories and labels per budget (#466) 2026-06-01 12:32:23 +02:00