fix: Remove missing users from assignment (#16115)
* remove missing users from assignment * early return
This commit is contained in:
@@ -74,11 +74,13 @@ const CheckedHostField = ({
|
||||
}}
|
||||
value={(value || [])
|
||||
.filter(({ isFixed: _isFixed }) => isFixed === _isFixed)
|
||||
.map((host) => {
|
||||
.reduce((acc, host) => {
|
||||
const option = options.find((member) => member.value === host.userId.toString());
|
||||
return option ? { ...option, priority: host.priority ?? 2, isFixed } : options[0];
|
||||
})
|
||||
.filter(Boolean)}
|
||||
if (!option) return acc;
|
||||
|
||||
acc.push({ ...option, priority: host.priority ?? 2, isFixed });
|
||||
return acc;
|
||||
}, [] as CheckedSelectOption[])}
|
||||
controlShouldRenderValue={false}
|
||||
options={options}
|
||||
placeholder={placeholder}
|
||||
|
||||
Reference in New Issue
Block a user