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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user