Skip to content

Commit

Permalink
Revert some useForm changes as its not passing test and no need it an…
Browse files Browse the repository at this point in the history
…ymore
  • Loading branch information
jardakotesovec committed Sep 19, 2024
1 parent c385302 commit 3bf7ce8
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/composables/useForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,16 @@ export function useForm(_form) {
field.selected = {};

Object.keys(inputValue).forEach((localeKey) => {
if (
Object.prototype.hasOwnProperty.call(
inputValue[localeKey],
'label',
) &&
Object.prototype.hasOwnProperty.call(inputValue[localeKey], 'value')
) {
field.selected[localeKey] = inputValue[localeKey];
field.value[localeKey] = mapFromSelectedToValue(
inputValue[localeKey],
);
} else {
field.value[localeKey] = inputValue[localeKey];
field.selected[localeKey] = inputValue[localeKey].map((val) => ({
label: val,
value: val,
}));
}
field.value[localeKey] = mapFromSelectedToValue(
inputValue[localeKey],
);
});
} else {
const onlyValues = mapFromSelectedToValue(inputValue);
field.value = onlyValues;
field.selected = inputValue;
}
field.selected = inputValue;
} else {
field.value = inputValue;
}
Expand Down

0 comments on commit 3bf7ce8

Please sign in to comment.