@@ -94,11 +94,6 @@ export class WorkspaceService {
9494 userId : string ,
9595 currentUser : DecodedUserObject ,
9696 ) : Promise < Workspace [ ] > {
97- if ( currentUser ?. _id . toString ( ) !== userId . toString ( ) ) {
98- throw new BadRequestException (
99- "You are not authorised to fetch the workspace details of this particular user" ,
100- ) ;
101- }
10297 const user = await this . userRepository . getUserById ( userId , currentUser ) ;
10398 if ( ! user ) {
10499 throw new BadRequestException (
@@ -262,7 +257,7 @@ export class WorkspaceService {
262257 }
263258 throw new BadRequestException ( "You don't have access of this Workspace" ) ;
264259 }
265-
260+
266261 /**
267262 * Creates a new workspace in the database
268263 * @param {CreateOrUpdateWorkspaceDto } workspaceData
@@ -286,16 +281,12 @@ export class WorkspaceService {
286281 }
287282 const planData = teamData ?. plan ;
288283 const uuid = new ObjectId ( ) ;
289- const ws = {
284+ const ws = {
290285 id : uuid ,
291286 name : workspaceData . name ,
292287 } ;
293- const res = await this . teamRepository . updateTeamWorkspaceCountById (
294- teamId ,
295- planData ,
296- ws ,
297- ) ;
298- if ( ! res ) {
288+ const res = await this . teamRepository . updateTeamWorkspaceCountById ( teamId , planData , ws ) ;
289+ if ( ! res ) {
299290 throw new ForbiddenException ( "Plan limit reached" ) ;
300291 }
301292 const createEnvironmentDto : CreateEnvironmentDto = {
0 commit comments