Add hierarchical region data to candidate and center records

This commit is contained in:
2026-07-20 11:50:51 +08:00 Unverified
parent 352f471ed0
commit c5446d5241
21 changed files with 387 additions and 64 deletions
+4
View File
@@ -1,3 +1,5 @@
import { mountRegionSelects } from './region-select.mjs';
export function createCandidateViews(context) {
const {
state,
@@ -70,6 +72,7 @@ export function createCandidateViews(context) {
const data = await api('/api/candidate/profile');
state.pageData = data; state.profile = data.profile;
app.innerHTML = onboardingShell('profile', candidateProfile(data, true));
mountRegionSelects(app, data.profile, { className: 'region-selects wide-field' });
} catch (error) { renderError(error); }
return;
}
@@ -95,6 +98,7 @@ export function createCandidateViews(context) {
results: () => candidateResults(data), notices: () => candidateNotices(data.notices)
}[page]();
app.innerHTML = portalShell('candidate', page, content, ...meta[page]);
if (page === 'profile') mountRegionSelects(app, data.profile, { className: 'region-selects wide-field' });
} catch (error) { renderError(error); }
}