chore: add api errors

This commit is contained in:
Nathnael
2026-06-24 12:48:42 +00:00
parent b31b27ce52
commit 2261675e21
2 changed files with 18 additions and 0 deletions

View File

@@ -393,6 +393,10 @@ export default function OnboardingWizardDialog({
roleProfiles,
licenseFiles,
onLicenseChange: setLicenseFiles,
// Surface a failed final submit (license/document upload or complete) inside
// the form — otherwise the server message (e.g. a 500) would be invisible on
// the submit step.
submitError: phase === "form" ? startError : null,
};
return (

View File

@@ -292,6 +292,7 @@ export default function CompanyProfileForm({
roleProfiles,
licenseFiles,
onLicenseChange,
submitError,
}: {
documentSettingCode: string;
documentFiles?: Record<string, File | File[] | null>;
@@ -319,6 +320,8 @@ export default function CompanyProfileForm({
/** Newly-selected license files per profile id. */
licenseFiles?: Record<string, File[]>;
onLicenseChange?: (value: Record<string, File[]>) => void;
/** Server error from the final submit (uploads/complete), shown verbatim. */
submitError?: string | null;
}) {
const [step, setStep] = useState<CompanyStep>(initialStep ?? "company");
const [saving, setSaving] = useState(false);
@@ -934,6 +937,17 @@ export default function CompanyProfileForm({
</Alert>
)}
{submitError && (
<Alert
color="red"
variant="light"
icon={<AlertCircle size={18} />}
title="Couldn't submit your application"
>
{submitError}
</Alert>
)}
<Group justify="space-between" pt="xs">
{showBack ? (
<Button