mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 11:40:39 +09:00
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:
commit
90d39b9cbd
2 changed files with 12 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue