@peektravel/app-utilities 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2355,18 +2355,18 @@ function fromTimeslotNode(node, productId) {
2355
2355
  assignedResources: mapAssignedResources(node.inheritedResourceAllocations)
2356
2356
  };
2357
2357
  }
2358
+ var ACTIVE_ALLOCATION_STATUS = "ACTIVE";
2358
2359
  function mapAssignedResources(allocations) {
2359
2360
  if (!Array.isArray(allocations) || allocations.length === 0) {
2360
2361
  return [];
2361
2362
  }
2362
- return allocations.map((allocation) => {
2363
+ return allocations.filter((allocation) => allocation.status === ACTIVE_ALLOCATION_STATUS).map((allocation) => {
2363
2364
  const pool = allocation.resourcePool;
2364
2365
  return {
2365
2366
  name: pool?.name || "",
2366
2367
  capacity: pool?.capacity ?? 0,
2367
2368
  category: pool?.category || "",
2368
2369
  quantity: allocation.quantity ?? 0,
2369
- status: allocation.status || "",
2370
2370
  accountUserId: pool?.accountUser?.id ?? null
2371
2371
  };
2372
2372
  });