Skip to content

Commit

Permalink
Merge pull request #8 from CrystallizeAPI/feat/generate-sku
Browse files Browse the repository at this point in the history
feat: generate SKU if undefined
  • Loading branch information
dhairyadwivedi authored Oct 9, 2024
2 parents 88cd5fb + ebc1ee6 commit 4588da1
Showing 1 changed file with 1 addition and 1 deletion.
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']] ? `${row[mapping['variant.sku']]}` : `${Date.now()}`;
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

0 comments on commit 4588da1

Please sign in to comment.