fix(workspaces): add filtering to workspace team query (#2586)

* chore(workspaces): add some tests for new filters

* fix(workspaces): args style
This commit is contained in:
Chuck Driesler
2024-08-08 06:15:55 +01:00
committed by GitHub
parent 72017c3f2f
commit 7bb40134eb
9 changed files with 179 additions and 45 deletions
@@ -72,7 +72,7 @@ import {
queryAllWorkspaceProjectsFactory
} from '@/modules/workspaces/services/projects'
import { getWorkspacesForUserFactory } from '@/modules/workspaces/services/retrieval'
import { Roles, WorkspaceRoles } from '@speckle/shared'
import { Roles, WorkspaceRoles, removeNullOrUndefinedKeys } from '@speckle/shared'
import { chunk } from 'lodash'
import { deleteStream } from '@/modules/core/repositories/streams'
@@ -426,10 +426,11 @@ export = FF_WORKSPACES_MODULE_ENABLED
const workspace = await ctx.loaders.workspaces!.getWorkspace.load(parent.id)
return workspace?.role || null
},
team: async (parent) => {
team: async (parent, args) => {
const getTeam = getWorkspaceCollaboratorsFactory({ db })
const collaborators = await getTeam({
workspaceId: parent.id
workspaceId: parent.id,
filter: removeNullOrUndefinedKeys(args?.filter ?? {})
})
return collaborators