File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,9 @@ export function WorkspaceSearch(props: Props) {
68
68
const search = async ( ) => {
69
69
setSearching ( true ) ;
70
70
try {
71
- const query : AdminGetWorkspacesQuery = { } ;
71
+ const query : AdminGetWorkspacesQuery = {
72
+ ownerId : props ?. user ?. id , // Workspace search in admin user detail
73
+ } ;
72
74
if ( matchesInstanceIdOrLegacyWorkspaceIdExactly ( queryTerm ) ) {
73
75
query . instanceIdOrWorkspaceId = queryTerm ;
74
76
} else if ( matchesNewWorkspaceIdExactly ( queryTerm ) ) {
Original file line number Diff line number Diff line change @@ -768,6 +768,10 @@ export abstract class AbstractTypeORMWorkspaceDBImpl implements WorkspaceDB {
768
768
} else if ( query . workspaceId ) {
769
769
whereConditions . push ( "ws.id = :workspaceId" ) ;
770
770
whereConditionParams . workspaceId = query . workspaceId ;
771
+ } else if ( query . ownerId ) {
772
+ // If an owner id is provided only search for workspaces belonging to that user.
773
+ whereConditions . push ( "ws.ownerId = :ownerId" ) ;
774
+ whereConditionParams . ownerId = query . ownerId ;
771
775
} else if ( query . instanceId ) {
772
776
// in addition to adding "instanceId" to the "WHERE" clause like for the other workspace-guided queries,
773
777
// we modify the JOIN condition below to a) select the correct instance and b) make the query faster
Original file line number Diff line number Diff line change @@ -116,4 +116,5 @@ export type AdminGetWorkspacesQuery = {
116
116
instanceIdOrWorkspaceId ?: string ;
117
117
instanceId ?: string ;
118
118
workspaceId ?: string ;
119
+ ownerId ?: string ;
119
120
} ;
You can’t perform that action at this time.
0 commit comments