fix type error

This commit is contained in:
Pallavi Kumari
2025-10-20 22:31:26 +05:30
parent 49bc2dc5da
commit ad6bb3da9f

View File

@@ -57,6 +57,7 @@ type JoinedRow = {
proxyPort: number | null;
enabled: boolean;
domainId: string | null;
headerAuthId: number | null;
targetId: number | null;
targetIp: string | null;
@@ -262,14 +263,19 @@ export async function listResources(
proxyPort: row.proxyPort,
enabled: row.enabled,
domainId: row.domainId,
niceId: row.niceId,
headerAuthId: row.headerAuthId,
targets: [],
};
map.set(row.resourceId, entry);
}
// Push target if present (left join can be null)
if (row.targetId != null && row.targetIp && row.targetPort != null && row.targetEnabled != null) {
// Push target if present
if (
row.targetId != null &&
row.targetIp &&
row.targetPort != null &&
row.targetEnabled != null
) {
entry.targets.push({
targetId: row.targetId,
ip: row.targetIp,