Skip to content

Commit 07c1558

Browse files
masiulish-bragg
andauthored
Update src/steps/MatchColumnsStep/utils/setColumn.ts
Co-authored-by: Harry Bragg <[email protected]>
1 parent d642692 commit 07c1558

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/steps/MatchColumnsStep/utils/setColumn.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ export const setColumn = <T extends string>(
99
): Column<T> => {
1010
switch (field?.fieldType.type) {
1111
case "select":
12-
const matchedOptions = uniqueEntries(data || [], oldColumn.index)?.map(option => {
13-
const value = options.find(o => o.value == option.value || o.label == option.entry)?.value
12+
const uniqueData = uniqueEntries(data || [], oldColumn.index)
13+
const matchedOptions = uniqueData?.map(option => {
14+
const value = field.fieldType.options.find(o => o.value == option.value || o.label == option.entry)?.value
1415
return value ? {...option, value} as MatchedOptions<T> : option as MatchedOptions<T>
1516
})
16-
const allMatched = matchedOptions.filter(o => o.value).length == options.length
17+
const allMatched = matchedOptions.filter(o => o.value).length == uniqueData?.length
1718

1819
return {
1920
...oldColumn,

0 commit comments

Comments
 (0)