Skip to content

Commit

Permalink
Fix duplicate crop columns.
Browse files Browse the repository at this point in the history
  • Loading branch information
lublagg committed Dec 20, 2023
1 parent 5db2b15 commit aafef70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ export const getAllAttrs = (selectedOptions: IStateOptions) => {
}
} else if (typeof short_desc === "object" && cropUnits) {
const attr = short_desc[cropUnits as keyof ICropDataItem][0];
allAttrs.push({"name": attrToCODAPColumnName[attr].attributeNameInCodapTable});
const codapColumnName = attrToCODAPColumnName[attr].attributeNameInCodapTable;
const codapColumnUnit = attrToCODAPColumnName[attr].unitInCodapTable;
allAttrs.push({"name": codapColumnName, "unit": codapColumnUnit});
allAttrs.push({"name": codapColumnName, "unit": codapColumnUnit});
}
}
}
Expand Down Expand Up @@ -209,6 +208,7 @@ export const createTableFromSelections = async (selectedOptions: IStateOptions,
return "success";
} else {
const attrDefinitions = allAttrs.map((attr) => makeCODAPAttributeDef(attr, geographicLevel));
console.log("attrDefinitions", attrDefinitions);

Check warning on line 211 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / Build and Run Jest Tests

Unexpected console statement

Check warning on line 211 in src/scripts/api.ts

View workflow job for this annotation

GitHub Actions / S3 Deploy

Unexpected console statement
await createParentCollection(dataSetName, "Data", attrDefinitions);
await createItems(dataSetName, items);
await createTable(dataSetName, dataSetName);
Expand Down

0 comments on commit aafef70

Please sign in to comment.