Skip to content

Commit 8e3f4c2

Browse files
committed
fix: form names
1 parent a8419c7 commit 8e3f4c2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/frontend/src/components/questionnaire/calendar/EntryForm.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,18 @@ export function EntityForm({ onSave, actionLabel, entry }: EntityFormProps) {
8686
return (
8787
<form onSubmit={f.onSubmit(onSave)}>
8888
<Stack>
89-
<CarerSelect {...f.getInputProps("carerId")} placeholder={t.labelCarer} />
89+
<CarerSelect {...f.getInputProps("carer")} placeholder={t.labelCarer} />
9090

9191
{f.getValues().entryLanguages.map((_, index) => (
9292
// TODO: make key either languageId or name of new language entry
9393
<Group key={`entry-${index}`} justify="stretch">
94-
<NumberInput {...f.getInputProps(`languageEntries.${index}.ratio`)} max={100} min={1} w={80} rightSection="%" />
95-
<LanguageSelect {...f.getInputProps(`languageEntries.${index}.languageId`)} flex={1} placeholder={t.labelLanguage} />
94+
<NumberInput {...f.getInputProps(`entryLanguages.${index}.ratio`)} max={100} min={1} w={80} rightSection="%" />
95+
<LanguageSelect {...f.getInputProps(`entryLanguages.${index}.language`)} flex={1} placeholder={t.labelLanguage} />
9696
{!!index && (
9797
<ActionIcon
9898
variant="light"
9999
onClick={() => {
100-
f.removeListItem("languageEntries", index);
100+
f.removeListItem("entryLanguages", index);
101101
updateRatios();
102102
}}
103103
>
@@ -112,9 +112,9 @@ export function EntityForm({ onSave, actionLabel, entry }: EntityFormProps) {
112112
const currentRatio = getTotalRatio();
113113

114114
if (currentRatio < 100) {
115-
f.insertListItem("languageEntries", { ratio: 100 - currentRatio });
115+
f.insertListItem("entryLanguages", { ratio: 100 - currentRatio });
116116
} else {
117-
f.insertListItem("languageEntries", { ratio: 0 });
117+
f.insertListItem("entryLanguages", { ratio: 0 });
118118
updateRatios();
119119
}
120120
}}

0 commit comments

Comments
 (0)