mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
feat(dropdown): optimize getDropdownOptionsFromArray to ensure unique values
This commit is contained in:
@@ -80,7 +80,8 @@ export default class DropdownUtil {
|
||||
public static getDropdownOptionsFromArray(
|
||||
arr: Array<string>,
|
||||
): Array<DropdownOption> {
|
||||
return arr.map((item: string) => {
|
||||
const uniqueArr: Array<string> = [...new Set(arr)];
|
||||
return uniqueArr.map((item: string) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
|
||||
Reference in New Issue
Block a user