Skip to content

Commit

Permalink
fix: set scayle product variant attributes as empty object
Browse files Browse the repository at this point in the history
  • Loading branch information
Benj0s committed Jan 20, 2025
1 parent 411bf9b commit 506bca4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions src/codec/codecs/commerce/scayle/__snapshots__/scayle.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports[`scayle integration getCategory by slug 1`] = `
"slug": "LEV0074002000005",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "31",
"images": [
{
Expand Down Expand Up @@ -148,7 +148,7 @@ exports[`scayle integration getProduct by ID 1`] = `
"slug": "LEV0074002000005",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "31",
"images": [
{
Expand Down Expand Up @@ -187,7 +187,7 @@ exports[`scayle integration getProducts by IDs 1`] = `
"slug": "THS0906008000001",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "1",
"images": [
{
Expand Down Expand Up @@ -219,7 +219,7 @@ exports[`scayle integration getProducts by IDs 1`] = `
"slug": "THS0906006000001",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "4",
"images": [
{
Expand Down Expand Up @@ -256,7 +256,7 @@ exports[`scayle integration getProducts by categories - paginated 1`] = `
"slug": "LIJ0480001000004",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "40",
"images": [
{
Expand Down Expand Up @@ -288,7 +288,7 @@ exports[`scayle integration getProducts by categories - paginated 1`] = `
"slug": "LEV0031009000002",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "37",
"images": [
{
Expand Down Expand Up @@ -320,7 +320,7 @@ exports[`scayle integration getProducts by categories - paginated 1`] = `
"slug": "LEV0031001002000",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "34",
"images": [
{
Expand Down Expand Up @@ -352,7 +352,7 @@ exports[`scayle integration getProducts by categories - paginated 1`] = `
"slug": "LEV0074002000005",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "31",
"images": [
{
Expand Down Expand Up @@ -389,7 +389,7 @@ exports[`scayle integration getProducts by category id 1`] = `
"slug": "LEV0074002000005",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "31",
"images": [
{
Expand Down Expand Up @@ -429,7 +429,7 @@ exports[`scayle integration getProducts by keyword - paginated 1`] = `
"slug": "LIJ0480001000004",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "40",
"images": [
{
Expand Down Expand Up @@ -461,7 +461,7 @@ exports[`scayle integration getProducts by keyword - paginated 1`] = `
"slug": "LEV0031009000002",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "37",
"images": [
{
Expand Down Expand Up @@ -493,7 +493,7 @@ exports[`scayle integration getProducts by keyword - paginated 1`] = `
"slug": "LEV0031001002000",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "34",
"images": [
{
Expand Down Expand Up @@ -525,7 +525,7 @@ exports[`scayle integration getProducts by keyword - paginated 1`] = `
"slug": "LEV0074002000005",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "31",
"images": [
{
Expand Down Expand Up @@ -562,7 +562,7 @@ exports[`scayle integration getProducts by keyword 1`] = `
"slug": "LEV0074002000005",
"variants": [
{
"attributes": undefined,
"attributes": {},
"id": "31",
"images": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/codec/codecs/commerce/scayle/mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const mapProductVariants = (variant: ScaylaProductVariant): Variant => {
salePrice: formatMoneyString(variant.price?.withTax, {
currency: variant.price?.currencyCode
}),
attributes: undefined,
attributes: {},
images: variant.images
}
}
Expand Down

0 comments on commit 506bca4

Please sign in to comment.