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,7 +1,6 @@
|
||||
import { SpreadsheetImportFields } from '@/spreadsheet-import/types';
|
||||
import lavenstein from 'js-levenshtein';
|
||||
|
||||
import { Fields } from '@/spreadsheet-import/types';
|
||||
|
||||
type AutoMatchAccumulator<T> = {
|
||||
distance: number;
|
||||
value: T;
|
||||
@ -9,7 +8,7 @@ type AutoMatchAccumulator<T> = {
|
||||
|
||||
export const findMatch = <T extends string>(
|
||||
header: string,
|
||||
fields: Fields<T>,
|
||||
fields: SpreadsheetImportFields<T>,
|
||||
autoMapDistance: number,
|
||||
): T | undefined => {
|
||||
const smallestValue = fields.reduce<AutoMatchAccumulator<T>>((acc, field) => {
|
||||
|
||||
Reference in New Issue
Block a user