Refactor spreadsheet import (#11250)
Mostly renaming objects to avoid conflicts (it was painful because names were too generic so you could cmd+replace easily) Also refactoring `useBuildAvailableFieldsForImport`
This commit is contained in:
@ -1,14 +1,12 @@
|
||||
import uniqBy from 'lodash.uniqby';
|
||||
|
||||
import {
|
||||
MatchColumnsStepProps,
|
||||
MatchedOptions,
|
||||
} from '@/spreadsheet-import/steps/components/MatchColumnsStep/MatchColumnsStep';
|
||||
import { MatchColumnsStepProps } from '@/spreadsheet-import/steps/components/MatchColumnsStep/MatchColumnsStep';
|
||||
import { SpreadsheetMatchedOptions } from '@/spreadsheet-import/types/SpreadsheetMatchedOptions';
|
||||
|
||||
export const uniqueEntries = <T extends string>(
|
||||
data: MatchColumnsStepProps['data'],
|
||||
index: number,
|
||||
): Partial<MatchedOptions<T>>[] =>
|
||||
): Partial<SpreadsheetMatchedOptions<T>>[] =>
|
||||
uniqBy(
|
||||
data.map((row) => ({ entry: row[index] })),
|
||||
'entry',
|
||||
|
||||
Reference in New Issue
Block a user