refactor(patient/fields): deduplicate religion options using Map
Use Map to ensure unique values in religion options array to prevent duplicate entries in the dropdown
This commit is contained in:
@@ -34,13 +34,17 @@ const extendOptions = [
|
|||||||
{ label: 'Kepercayaan Lain', value: 'other', priority: -1 },
|
{ label: 'Kepercayaan Lain', value: 'other', priority: -1 },
|
||||||
]
|
]
|
||||||
|
|
||||||
const religionOptions = [
|
const religionOptions = Array.from(
|
||||||
...mapToComboboxOptList(religionCodes).map(({ label, value }) => ({
|
new Map(
|
||||||
label,
|
[
|
||||||
value,
|
...mapToComboboxOptList(religionCodes).map(({ label, value }) => ({
|
||||||
})),
|
label,
|
||||||
...extendOptions,
|
value,
|
||||||
]
|
})),
|
||||||
|
...extendOptions,
|
||||||
|
].map((item) => [item.value, item]),
|
||||||
|
).values(),
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user