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:
Khafid Prayoga
2025-11-24 12:12:42 +07:00
parent bc517c15d9
commit 857478cd65
@@ -34,13 +34,17 @@ const extendOptions = [
{ label: 'Kepercayaan Lain', value: 'other', priority: -1 },
]
const religionOptions = [
...mapToComboboxOptList(religionCodes).map(({ label, value }) => ({
label,
value,
})),
...extendOptions,
]
const religionOptions = Array.from(
new Map(
[
...mapToComboboxOptList(religionCodes).map(({ label, value }) => ({
label,
value,
})),
...extendOptions,
].map((item) => [item.value, item]),
).values(),
)
</script>
<template>