feat(wizard): connect license lookup panel to real lic server api endpoint
All checks were successful
Staging Build / build (push) Successful in 2m48s

This commit is contained in:
DanielS
2026-07-15 01:01:01 +02:00
parent f783a98392
commit 6b9023c871
2 changed files with 47 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ import {
} from 'lucide-react'
import { Input } from '@/components/ui/input'
import { Badge } from '@/components/ui/badge'
import { lookupLicenseFromLicServer } from '@/lib/actions/licserver-config'
// ─── MOCK DATA (until real LicServer API is wired up) ───────────────────────
const MOCK_LICENSES: Record<string, LicenseInfo> = {
@@ -136,11 +137,14 @@ function fmt(dateStr: string) {
})
}
// ─── MOCK LOOKUP (replace with real LicServer API call) ──────────────────────
// ─── LOOKUP (tries real LicServer API call, falls back to MOCK in dev) ──────────────────────
async function lookupLicense(key: string): Promise<LicenseInfo | null> {
// TODO: replace with → fetch(`/api/license-lookup?key=${encodeURIComponent(key)}`)
await new Promise(r => setTimeout(r, 800)) // simulate network latency
return MOCK_LICENSES[key.trim().toUpperCase()] ?? null
try {
return await lookupLicenseFromLicServer(key)
} catch (err) {
console.error('Lookup failed, falling back to mock details:', err)
return MOCK_LICENSES[key.trim().toUpperCase()] ?? null
}
}
// ─── MAIN COMPONENT ───────────────────────────────────────────────────────────