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
commit 90d39b9cbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;