File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
src/modules/workspace/repositories Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,6 @@ export class WorkspaceRepository {
121121 . collection ( Collections . WORKSPACE )
122122 . findOne ( { _id : id } ) ;
123123 // Check if workspace is restricted
124- if ( ! response ) {
125- throw new BadRequestException ( "Workspace not found." ) ;
126- }
127- if ( response ?. isRestricted === true || response ?. isFreezed === true ) {
128- console . log ( `Access denied: Workspace ${ id } is restricted` ) ;
129- throw new BadRequestException (
130- "This workspace is restricted and cannot be accessed." ,
131- ) ;
132- }
133124 return response ;
134125 }
135126
@@ -141,11 +132,11 @@ export class WorkspaceRepository {
141132 . find ( { _id : { $in : IdArray } } )
142133 . toArray ( ) ;
143134 if ( ! response || response . length === 0 ) {
144- throw new BadRequestException ( "No workspaces found." ) ;
135+ return response ;
145136 }
146137 // Filter out restricted workspaces
147138 const filteredResponse = response . filter ( ( workspace ) => {
148- if ( workspace ?. isRestricted === true ) {
139+ if ( workspace ?. isRestricted || workspace ?. isFreezed ) {
149140 return false ;
150141 }
151142 return true ;
You can’t perform that action at this time.
0 commit comments