Merge pull request #8 from numman-ali/fix/filter-terminated-agents-from-list-and-org

fix: exclude terminated agents from list and org chart endpoints
This commit is contained in:
Dotta
2026-03-05 09:46:38 -06:00
committed by GitHub
2 changed files with 12 additions and 5 deletions

View File

@@ -564,7 +564,7 @@ export function companyPortabilityService(db: Db) {
requiredSecrets: [],
};
const allAgentRows = include.agents ? await agents.list(companyId) : [];
const allAgentRows = include.agents ? await agents.list(companyId, { includeTerminated: true }) : [];
const agentRows = allAgentRows.filter((agent) => agent.status !== "terminated");
if (include.agents) {
const skipped = allAgentRows.length - agentRows.length;