Skip to content

Commit

Permalink
Rename parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
fhennig committed Jan 17, 2025
1 parent be7b42d commit d8d1616
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions website/src/components/Submission/FileUpload/ColumnMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export class ColumnMapping {

/* Update the mapping with new source and target columns, trying to keep as much of the
mapping intact as possible. */
public update(newSourceColumns: string[], inputFields: InputField[]): ColumnMapping {
public update(newSourceColumns: string[], newInputFields: InputField[]): ColumnMapping {
const newMapping = new Map(
newSourceColumns.map((newSourceCol) => {
const prevTargetCol = this.map.get(newSourceCol);
if (prevTargetCol && inputFields.map((f) => f.name).includes(prevTargetCol)) {
if (prevTargetCol && newInputFields.map((f) => f.name).includes(prevTargetCol)) {
return [newSourceCol, prevTargetCol];
} else {
return [newSourceCol, ColumnMapping.getBestMatchingTargetColumn(newSourceCol, inputFields)];
return [newSourceCol, ColumnMapping.getBestMatchingTargetColumn(newSourceCol, newInputFields)];
}
}),
);
Expand Down

0 comments on commit d8d1616

Please sign in to comment.