From 51a435f3400f61b3d66d9c33e7f92a1562e10519 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 26 Feb 2025 08:02:51 -0400 Subject: [PATCH] feat: return 'isActive' in additionalProperty --- vtex/utils/transform.ts | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/vtex/utils/transform.ts b/vtex/utils/transform.ts index 0592c84e8..569924ca2 100644 --- a/vtex/utils/transform.ts +++ b/vtex/utils/transform.ts @@ -1196,6 +1196,7 @@ export function toPlace( longitude, openingHoursSpecification, specialOpeningHoursSpecification, + isActive, } = isPickupPointVCS(pickupPoint) ? { name: pickupPoint.name, @@ -1208,6 +1209,7 @@ export function toPlace( openingHoursSpecification: pickupPoint.businessHours?.map( toHoursSpecification, ), + isActive: pickupPoint.isActive ?? false, } : { name: pickupPoint.friendlyName, @@ -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 { @@ -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}`, + }, + ], }; }