Skip to content

Commit

Permalink
feat: return 'isActive' in additionalProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoUwu committed Feb 26, 2025
1 parent 178ac70 commit 51a435f
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions vtex/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ export function toPlace(
longitude,
openingHoursSpecification,
specialOpeningHoursSpecification,
isActive,
} = isPickupPointVCS(pickupPoint)
? {
name: pickupPoint.name,
Expand All @@ -1208,6 +1209,7 @@ export function toPlace(
openingHoursSpecification: pickupPoint.businessHours?.map(
toHoursSpecification,
),
isActive: pickupPoint.isActive ?? false,
}
: {
name: pickupPoint.friendlyName,
Expand All @@ -1226,6 +1228,8 @@ export function toPlace(
openingTime: OpeningTime,
})
),
// this object comes from the checkout api, that should only show the active pickup points, let's hope it's true
isActive: true,
};

return {
Expand All @@ -1244,10 +1248,17 @@ export function toPlace(
name,
specialOpeningHoursSpecification,
openingHoursSpecification,
additionalProperty: [{
"@type": "PropertyValue",
name: "distance",
value: `${pickupPoint.distance}`,
}],
additionalProperty: [
{
"@type": "PropertyValue",
name: "distance",
value: `${pickupPoint.distance}`,
},
{
"@type": "PropertyValue",
name: "isActive",
value: `${isActive}`,
},
],
};
}

0 comments on commit 51a435f

Please sign in to comment.