Skip to content

Commit 74e61b2

Browse files
committed
fix: resolve pr review comments
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 0cf29ed commit 74e61b2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

backend/src/middlewares/segmentMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { NextFunction, Request, Response } from 'express'
33
import { IRepositoryOptions } from '../database/repositories/IRepositoryOptions'
44
import SegmentRepository from '../database/repositories/segmentRepository'
55

6-
/** Resolves active segment(s) from the request and sets `req.currentSegments` for downstream handlers. */
6+
/** Resolves segment(s) from the request and sets `req.currentSegments` for downstream handlers. */
77
export async function segmentMiddleware(req: Request, _res: Response, next: NextFunction) {
88
try {
99
const options = req as unknown as IRepositoryOptions

services/libs/data-access-layer/src/segments/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export async function getSegmentSubprojects(
196196
select s.*
197197
from segments s
198198
join segment_level sl on (sl.level = 'child' and s.id = sl.id)
199-
or (sl.level = 'parent' and s."parentSlug" = sl.slug and s."grandparentSlug" is not null)
199+
or (sl.level = 'parent' and s."parentSlug" = sl.slug and s."grandparentSlug" = sl."parentSlug")
200200
or (sl.level = 'grandparent' and s."grandparentSlug" = sl.slug)
201201
where status = 'active'
202202
and s."tenantId" = $(tenantId);

0 commit comments

Comments
 (0)