mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-20 15:01:19 +00:00
feat: schoolist splits only once
This commit is contained in:
parent
9932ce87b7
commit
3a9b479934
2 changed files with 6 additions and 4 deletions
|
|
@ -1,11 +1,10 @@
|
|||
<script lang="ts">
|
||||
import LL from '$i18n/i18n-svelte';
|
||||
|
||||
import schoollistString from '$lib/assets/schoollist.txt?raw';
|
||||
import School from './School.svelte';
|
||||
import type { School as SchoolType } from '$lib/stores/candidate';
|
||||
|
||||
const schoolList: Array<string> = schoollistString.split(';');
|
||||
export let schoolList: Array<string>;
|
||||
|
||||
let filteredSchools: Array<string> = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
let pagesFilled = [false, false, false, false, false, false, false, false];
|
||||
const editModePageIndex = 3;
|
||||
const pageCount = pagesFilled.length;
|
||||
const schoolList: Array<string> = schoollistString.split(';');
|
||||
|
||||
let pageTexts = [
|
||||
$LL.candidate.register.second.title(),
|
||||
|
|
@ -152,7 +153,7 @@
|
|||
.required()
|
||||
.test((_val) => {
|
||||
if (!_val) return false;
|
||||
return schoollistString.split(';').includes(_val);
|
||||
return schoolList.includes(_val);
|
||||
}),
|
||||
field: yup.string().required()
|
||||
}),
|
||||
|
|
@ -162,7 +163,7 @@
|
|||
.required()
|
||||
.test((_val) => {
|
||||
if (!_val) return false;
|
||||
return schoollistString.split(';').includes(_val);
|
||||
return schoolList.includes(_val);
|
||||
}),
|
||||
field: yup.string().required()
|
||||
}),
|
||||
|
|
@ -745,6 +746,7 @@
|
|||
První škola - termín JPZ: <span class="underline">13. 4. 2023</span>
|
||||
</h2>
|
||||
<SchoolSelect
|
||||
schoolList={schoolList}
|
||||
error={$typedErrors['candidate']['firstSchool']['name'] ||
|
||||
$typedErrors['candidate']['firstSchool']['field']}
|
||||
bind:selectedSchool={$form.candidate.firstSchool}
|
||||
|
|
@ -768,6 +770,7 @@
|
|||
Druhá škola - termín JPZ: <span class="underline">14. 4. 2023</span>
|
||||
</h2>
|
||||
<SchoolSelect
|
||||
schoolList={schoolList}
|
||||
error={$typedErrors['candidate']['secondSchool']['name'] ||
|
||||
$typedErrors['candidate']['secondSchool']['field']}
|
||||
bind:selectedSchool={$form.candidate.secondSchool}
|
||||
|
|
|
|||
Loading…
Reference in a new issue