Skip to content

Commit

Permalink
fix(import-app): fix string
Browse files Browse the repository at this point in the history
  • Loading branch information
Plopix committed Jun 25, 2024
1 parent e910bc4 commit 177b4d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const mapVariant = (
options?: MapVariantOptions,
): JSONProductVariant => {
const name = row[mapping[FIELD_MAPPINGS.item.name.key]];
const sku = row[mapping['variant.sku']];
const sku = `${row[mapping['variant.sku']]}`;
const images = row[mapping['variant.images']];
let price = row[mapping['variant.price']] ? Number.parseFloat(row[mapping['variant.price']]) : undefined;
const stock = row[mapping['variant.stock']] ? Number.parseFloat(row[mapping['variant.stock']]) : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const readCsv = async (file: File): Promise<Data> => {

const readXlsx = async (file: File): Promise<Data> => {
const allRows = await readXlsxFile(file);
const headers = allRows[0].map((col) => col.toString());
const headers = allRows[0].map((col) => `${col || ''}`.trim());
const rows = allRows.splice(1).map((row) =>
row.reduce((record: Record<string, any>, col, i) => {
record[headers[i]] = col;
Expand Down

0 comments on commit 177b4d4

Please sign in to comment.