feat(pitch-deck): change preferred_lang for existing investors from detail page
Build pitch-deck / build-push-deploy (push) Successful in 1m27s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 33s
CI / test-python-voice (push) Successful in 33s
CI / test-bqas (push) Successful in 34s

- GET /api/admin/investors/:id now returns preferred_lang
- PATCH /api/admin/investors/:id accepts preferred_lang (de/en), validates value
- Investor detail page: DE/EN toggle in the Pitch Version card, instant save on click

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-05-06 23:31:59 +02:00
parent b0d273d3ab
commit ec7eee8e3d
2 changed files with 43 additions and 8 deletions
@@ -22,6 +22,7 @@ interface InvestorDetail {
version_name: string | null
version_status: string | null
is_showcase: boolean
preferred_lang: 'de' | 'en'
}
sessions: Array<{
id: string
@@ -324,6 +325,39 @@ export default function InvestorDetailPage() {
</span>
</div>
{/* Default language */}
<div className="mt-4 pt-4 border-t border-white/[0.06]">
<div className="flex items-center justify-between">
<div>
<div className="text-sm text-white font-medium">Default pitch language</div>
<div className="text-xs text-white/40 mt-0.5">Language the deck opens in when the investor clicks the link</div>
</div>
<div className="flex rounded-lg border border-white/10 overflow-hidden">
{(['de', 'en'] as const).map(l => (
<button
key={l}
disabled={busy}
onClick={async () => {
if (inv.preferred_lang === l) return
setBusy(true)
const res = await fetch(`/api/admin/investors/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ preferred_lang: l }),
})
setBusy(false)
if (res.ok) { flashToast(`Language set to ${l.toUpperCase()}`); load() }
else { flashToast('Update failed') }
}}
className={`px-4 py-1.5 text-sm font-medium transition-colors disabled:opacity-50 ${inv.preferred_lang === l ? 'bg-indigo-600 text-white' : 'bg-black/20 text-white/50 hover:text-white/80'}`}
>
{l === 'de' ? '🇩🇪 DE' : '🇬🇧 EN'}
</button>
))}
</div>
</div>
</div>
{/* Showcase toggle */}
<div className="flex items-center justify-between mt-4 pt-4 border-t border-white/[0.06]">
<div>