Use search instead of findMany in relation pickers (#7798)
First step of #https://github.com/twentyhq/twenty/issues/3298. Here we update the search endpoint to allow for a filter argument, which we currently use in the relation pickers to restrict or exclude ids from search. In a future PR we will try to simplify the search logic in the FE
This commit is contained in:
@ -113,6 +113,52 @@ export const graphqlMocks = {
|
||||
},
|
||||
});
|
||||
}),
|
||||
graphql.query('SearchWorkspaceMembers', () => {
|
||||
return HttpResponse.json({
|
||||
data: {
|
||||
searchWorkspaceMembers: {
|
||||
edges: mockWorkspaceMembers.map((member) => ({
|
||||
node: {
|
||||
...member,
|
||||
messageParticipants: {
|
||||
edges: [],
|
||||
__typename: 'MessageParticipantConnection',
|
||||
},
|
||||
authoredAttachments: {
|
||||
edges: [],
|
||||
__typename: 'AttachmentConnection',
|
||||
},
|
||||
authoredComments: {
|
||||
edges: [],
|
||||
__typename: 'CommentConnection',
|
||||
},
|
||||
accountOwnerForCompanies: {
|
||||
edges: [],
|
||||
__typename: 'CompanyConnection',
|
||||
},
|
||||
authoredActivities: {
|
||||
edges: [],
|
||||
__typename: 'ActivityConnection',
|
||||
},
|
||||
favorites: {
|
||||
edges: [],
|
||||
__typename: 'FavoriteConnection',
|
||||
},
|
||||
connectedAccounts: {
|
||||
edges: [],
|
||||
__typename: 'ConnectedAccountConnection',
|
||||
},
|
||||
assignedActivities: {
|
||||
edges: [],
|
||||
__typename: 'ActivityConnection',
|
||||
},
|
||||
},
|
||||
cursor: null,
|
||||
})),
|
||||
},
|
||||
},
|
||||
});
|
||||
}),
|
||||
graphql.query('FindManyViewFields', ({ variables }) => {
|
||||
const viewId = variables.filter.view.eq;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user