Add condition to query to only retrieve the actual project id

This commit is contained in:
carlosmonastyrski
2025-03-06 16:38:49 -03:00
parent 8e311658d4
commit 3ca931acf1

View File

@@ -136,6 +136,8 @@ export const secretVersionV2BridgeDALFactory = (db: TDbClient) => {
`${TableName.SecretVersionV2}.userActorId`
)
.leftJoin(TableName.Identity, `${TableName.Identity}.id`, `${TableName.SecretVersionV2}.identityActorId`)
.where(`${TableName.ProjectMembership}.projectId`, projectId)
.orWhereNull(`${TableName.ProjectMembership}.projectId`)
.select(
selectAllTableCols(TableName.SecretVersionV2),
`${TableName.Users}.username as userActorName`,