fix: filter out existing emails

(cherry picked from commit 08bab927a2ad5fa06f3d1a000262e11a35f943fd)
This commit is contained in:
Shariq Ansari 2025-06-17 16:58:35 +05:30 committed by Mergify
parent f4c033fd52
commit 512970cad1

View File

@ -156,6 +156,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
existingEmails: {
type: Array,
default: () => [],
},
})
const values = defineModel()
@ -205,6 +209,14 @@ const filterOptions = createResource({
value: email,
}
})
// Filter out existing emails
if (props.existingEmails?.length) {
allData = allData.filter((option) => {
return !props.existingEmails.includes(option.value)
})
}
return allData
},
})