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 }, { 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>