fix: MCP OAuth 303 redirect, send dialog auto-close, bank details null payload (#175)

* fix: MCP OAuth 303 redirect, send dialog auto-close, bank details null payload

- OAuth authorize: use 303 See Other instead of default 307, which
  preserved POST method and caused Claude's callback to return 405
- SendInvoiceDialog: close dialog and show toast after email send
  instead of leaving a success message that requires manual close
- BankDetailsSetupDialog: omit empty fields from payload instead of
  sending null, which fails Zod validation on non-nullable schema fields

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor: remove dead sentMessage state and fix stale comment

Remove sentMessage state, its success banner JSX, and the CheckCircle2
import — all unreachable after the dialog now auto-closes on email send.
Fix stale "to null" comment in BankDetailsSetupDialog.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-04-04 10:27:40 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent c4a6d16e94
commit e2d9c8bb85
3 changed files with 37 additions and 53 deletions
@@ -98,14 +98,15 @@ export function BankDetailsSetupDialog({ open, onOpenChange, onComplete }: BankD
// Include bank name from combobox
data.bank_name = bankName
// Clean empty strings to null for API
// Omit empty strings — API schema accepts undefined but not null
const payload: Record<string, string | number | null> = {}
for (const [key, val] of Object.entries(data)) {
if (key === 'next_invoice_number') {
const num = val ? parseInt(val as string, 10) : null
if (num !== null) payload[key] = num
} else {
payload[key] = (val as string) || null
const str = val as string
if (str) payload[key] = str
}
}