Skip to content

Commit

Permalink
subsegments of used segment will show as used in segments list
Browse files Browse the repository at this point in the history
  • Loading branch information
Yagnik56 committed Oct 11, 2023
1 parent e22f85f commit d14df62
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/packages/Upgrade/src/api/services/SegmentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,24 @@ export class SegmentService {
});
}

segmentsData.forEach((segment) => {
segmentsUsedLockedList.forEach((usedSegment) => {
if (segment.id === usedSegment) {
segment.subSegments.forEach((subSegment) => {
segmentsUsedLockedList.push(subSegment.id);
});
}
});

segmentsUsedUnlockedList.forEach((usedSegment) => {
if (segment.id === usedSegment) {
segment.subSegments.forEach((subSegment) => {
segmentsUsedUnlockedList.push(subSegment.id);
});
}
});
});

const segmentsDataWithStatus = segmentsData.map((segment) => {
if (segment.id === globalExcludeSegment.id) {
return { ...segment, status: SEGMENT_STATUS.GLOBAL };
Expand Down

0 comments on commit d14df62

Please sign in to comment.