Add hierarchical region data to candidate and center records
This commit is contained in:
@@ -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); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user