diff --git a/src/components/dashboard/MyDashboardPage.tsx b/src/components/dashboard/MyDashboardPage.tsx index 93effd4..8cdd454 100644 --- a/src/components/dashboard/MyDashboardPage.tsx +++ b/src/components/dashboard/MyDashboardPage.tsx @@ -251,7 +251,7 @@ export default function MyDashboardPage(props: Props) { description: 'Fill profile and portfolio sections, upload required documents, then submit for verification.', }; }); - const showVerificationPrompt = createMemo(() => verificationStatus() !== 'APPROVED'); + const showVerificationPrompt = createMemo(() => !['APPROVED', 'COMPLETED'].includes(verificationStatus())); const showPortfolioCta = createMemo(() => PROFESSIONAL_ROLE_SET.has(props.roleKey) || props.roleKey === 'JOB_SEEKER'); const getEffectiveRole = (): RoleKey => { @@ -489,7 +489,7 @@ export default function MyDashboardPage(props: Props) { statusLabel={verificationStatus().replace(/_/g, ' ')} statusColor="#B7791F" locked={verificationStatus() === 'UNDER_REVIEW' || verificationStatus() === 'PENDING'} - approved={verificationStatus() === 'APPROVED'} + approved={['APPROVED', 'COMPLETED'].includes(verificationStatus())} missingBasicLabels={missingBasicLabels()} missingDocLabels={missingDocLabels()} missingPortfolioLabels={missingPortfolioLabels()} diff --git a/src/components/dashboard/ProfilePage.tsx b/src/components/dashboard/ProfilePage.tsx index 110a388..5119183 100644 --- a/src/components/dashboard/ProfilePage.tsx +++ b/src/components/dashboard/ProfilePage.tsx @@ -716,6 +716,27 @@ export default function ProfilePage(props: Props) { } } + if (props.roleKey === "JOB_SEEKER") { + try { + const docsRes = await apiFetch("/api/jobseeker/profile/documents"); + if (docsRes.ok) { + const docsPayload = await docsRes.json().catch(() => ({})); + const docs = Array.isArray(docsPayload?.data) ? docsPayload.data : []; + const savedDocs: Record = {}; + for (const doc of docs) { + const key = String(doc?.document_type || "").trim(); + const url = String(doc?.file_url || "").trim(); + if (key && url) savedDocs[key] = url; + } + if (Object.keys(savedDocs).length > 0) { + setDocUrls((prev) => ({ ...savedDocs, ...prev })); + } + } + } catch { + // Best-effort rehydration only. + } + } + if (statusRes.ok) { const s = await statusRes.json(); const nextStatus = String(s.status ?? "NOT_SUBMITTED"); @@ -1262,6 +1283,10 @@ export default function ProfilePage(props: Props) { const url = result?.url ?? result?.file_url ?? result?.path ?? String(result); setDocUrls(prev => ({ ...prev, [doc.key]: url })); setDocUploadErrors(prev => ({ ...prev, [doc.key]: "" })); + await request("/api/profile", { + method: "PATCH", + body: { roleKey: props.roleKey, profile_data: { ...form(), ...docUrls(), [doc.key]: url } }, + }); } catch (err: any) { setDocUploadErrors(prev => ({ ...prev, [doc.key]: err.message ?? "Upload failed" })); } diff --git a/src/components/dashboard/VerificationStatusPage.tsx b/src/components/dashboard/VerificationStatusPage.tsx index c639a85..e64f277 100644 --- a/src/components/dashboard/VerificationStatusPage.tsx +++ b/src/components/dashboard/VerificationStatusPage.tsx @@ -92,6 +92,14 @@ const STATUS_CONFIG: Record {/* Progress timeline */} - +

Verification Progress @@ -422,7 +431,7 @@ export default function VerificationStatusPage(props: Props) {

- +

🎉

@@ -539,7 +548,7 @@ export default function VerificationStatusPage(props: Props) {

- +
diff --git a/src/routes/dashboard.tsx b/src/routes/dashboard.tsx index a5e1764..eea9c85 100644 --- a/src/routes/dashboard.tsx +++ b/src/routes/dashboard.tsx @@ -580,7 +580,7 @@ function mergeSidebar( } const status = String(verificationStatus || "").toUpperCase(); - const approved = status === "APPROVED"; + const approved = status === "APPROVED" || status === "COMPLETED"; if (!approved && status) { // Once a role's verification wizard is enabled (admin-configurable, see // OnboardingSchemaEditor), My Profile / My Portfolio move inside the @@ -852,7 +852,7 @@ export default function RuntimeDashboardPage() { roleKey={role()} userName={userName()} isAdmin={isAdmin()} - verificationApproved={String(effectiveVerificationStatus() || '').toUpperCase() === 'APPROVED'} + verificationApproved={["APPROVED", "COMPLETED"].includes(String(effectiveVerificationStatus() || '').toUpperCase())} >