feat: initiate tag distributions
This commit is contained in:
@@ -226,17 +226,25 @@ export const FormApiBasedAutoComplete = ({
|
||||
setSelectedKeys(defaultItems.map((item: any) => item.key));
|
||||
if (onChange) {
|
||||
if (secondaryKey) {
|
||||
onChange({
|
||||
key1: defaultItems.map((item: any) => item.key),
|
||||
key2: defaultItems.map((item: any) => item.secondaryKey),
|
||||
...(tertiaryKey
|
||||
? {
|
||||
key3: defaultItems.map(
|
||||
(item: any) => item.tertiaryKey
|
||||
),
|
||||
}
|
||||
: {}),
|
||||
});
|
||||
console.log("dksk0", defaultItems);
|
||||
onChange(
|
||||
defaultItems.map((item: any) => {
|
||||
return {
|
||||
key: item?.key,
|
||||
key2: item?.secondaryKey,
|
||||
...(tertiaryKey
|
||||
? {
|
||||
key3: item?.tertiaryKey,
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
})
|
||||
);
|
||||
if (onChangeValue) {
|
||||
onChangeValue(
|
||||
defaultItems.map((item: any) => item.value.trim())
|
||||
);
|
||||
}
|
||||
} else {
|
||||
onChange(defaultItems.map((item: any) => item.key));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user