@@ -62,7 +62,7 @@ export class UserController {
62
62
private readonly userService : UserService ,
63
63
private readonly commonService : CommonService ,
64
64
private readonly awsService : AwsService
65
- ) { }
65
+ ) { }
66
66
67
67
/**
68
68
*
@@ -105,9 +105,9 @@ export class UserController {
105
105
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
106
106
}
107
107
108
- /**
108
+ /**
109
109
* Get public profile details of a user by username.
110
- *
110
+ *
111
111
* @param username The username of the user.
112
112
* @returns Public profile information.
113
113
*/
@@ -134,7 +134,6 @@ export class UserController {
134
134
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
135
135
}
136
136
137
-
138
137
/**
139
138
* Retrieves the profile details of the currently logged-in user.
140
139
*
@@ -149,7 +148,7 @@ export class UserController {
149
148
@ApiBearerAuth ( )
150
149
async getProfile ( @User ( ) reqUser : user , @Res ( ) res : Response ) : Promise < Response > {
151
150
const userData = await this . userService . getProfile ( reqUser . id ) ;
152
-
151
+
153
152
const finalResponse : IResponse = {
154
153
statusCode : HttpStatus . OK ,
155
154
message : ResponseMessages . user . success . fetchProfile ,
@@ -159,9 +158,9 @@ export class UserController {
159
158
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
160
159
}
161
160
162
- /**
161
+ /**
163
162
* Retrieves all platform settings.
164
- *
163
+ *
165
164
* @returns The platform settings.
166
165
*/
167
166
@Get ( '/platform-settings' )
@@ -185,11 +184,11 @@ export class UserController {
185
184
}
186
185
187
186
/**
188
- * Fetch user activities.
189
- *
190
- * @param limit - Number of activities to fetch.
191
- * @returns A response containing user activity data.
192
- */
187
+ * Fetch user activities.
188
+ *
189
+ * @param limit - Number of activities to fetch.
190
+ * @returns A response containing user activity data.
191
+ */
193
192
@Get ( '/activity' )
194
193
@ApiOperation ( {
195
194
summary : 'Fetch users activity' ,
@@ -214,12 +213,11 @@ export class UserController {
214
213
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
215
214
}
216
215
217
-
218
- /**
219
- * Fetch organization invitations.
220
- *
221
- * @returns A paginated list of organization invitations.
222
- */
216
+ /**
217
+ * Fetch organization invitations.
218
+ *
219
+ * @returns A paginated list of organization invitations.
220
+ */
223
221
@Get ( '/org-invitations' )
224
222
@ApiOperation ( {
225
223
summary : 'organization invitations' ,
@@ -248,7 +246,7 @@ export class UserController {
248
246
required : false
249
247
} )
250
248
async invitations (
251
- @Query ( ) getAllInvitationsDto : GetAllInvitationsDto ,
249
+ @Query ( ) getAllInvitationsDto : GetAllInvitationsDto ,
252
250
@User ( ) reqUser : user ,
253
251
@Res ( ) res : Response
254
252
) : Promise < Response > {
@@ -271,14 +269,17 @@ export class UserController {
271
269
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
272
270
}
273
271
274
- /**
275
- * Checks if a user is registered and verifies email existence.
276
- *
277
- * @param email The email address to check.
278
- * @returns Returns user registration and email verification status.
279
- */
272
+ /**
273
+ * Checks if a user is registered and verifies email existence.
274
+ *
275
+ * @param email The email address to check.
276
+ * @returns Returns user registration and email verification status.
277
+ */
280
278
@Get ( '/:email' )
281
- @ApiOperation ( { summary : 'Check user registration and email verification status' , description : 'Check if a user is already registered and if their email already exists.' } )
279
+ @ApiOperation ( {
280
+ summary : 'Check user registration and email verification status' ,
281
+ description : 'Check if a user is already registered and if their email already exists.'
282
+ } )
282
283
async checkUserExist ( @Param ( ) emailParam : EmailValidator , @Res ( ) res : Response ) : Promise < Response > {
283
284
const userDetails = await this . userService . checkUserExist ( emailParam . email ) ;
284
285
@@ -292,12 +293,12 @@ export class UserController {
292
293
}
293
294
294
295
/**
295
- * Accept or reject an organization invitation.
296
- *
297
- * @param invitationId The ID of the organization invitation.
298
- * @body AcceptRejectInvitationDto
299
- * @returns The status of the organization invitation response.
300
- */
296
+ * Accept or reject an organization invitation.
297
+ *
298
+ * @param invitationId The ID of the organization invitation.
299
+ * @body AcceptRejectInvitationDto
300
+ * @returns The status of the organization invitation response.
301
+ */
301
302
@Post ( '/org-invitations/:invitationId' )
302
303
@ApiOperation ( {
303
304
summary : 'accept/reject organization invitation' ,
@@ -306,8 +307,17 @@ export class UserController {
306
307
@UseGuards ( AuthGuard ( 'jwt' ) , UserAccessGuard )
307
308
@ApiBearerAuth ( )
308
309
async acceptRejectInvitaion (
309
- @Body ( ) acceptRejectInvitation : AcceptRejectInvitationDto ,
310
- @Param ( 'invitationId' , TrimStringParamPipe , new ParseUUIDPipe ( { exceptionFactory : ( ) : Error => { throw new BadRequestException ( `Invalid format for InvitationId` ) ; } } ) ) invitationId : string ,
310
+ @Body ( ) acceptRejectInvitation : AcceptRejectInvitationDto ,
311
+ @Param (
312
+ 'invitationId' ,
313
+ TrimStringParamPipe ,
314
+ new ParseUUIDPipe ( {
315
+ exceptionFactory : ( ) : Error => {
316
+ throw new BadRequestException ( `Invalid format for InvitationId` ) ;
317
+ }
318
+ } )
319
+ )
320
+ invitationId : string ,
311
321
@User ( ) reqUser : user ,
312
322
@Res ( ) res : Response
313
323
) : Promise < Response > {
@@ -320,13 +330,13 @@ export class UserController {
320
330
} ;
321
331
return res . status ( HttpStatus . CREATED ) . json ( finalResponse ) ;
322
332
}
323
-
333
+
324
334
/**
325
- * Updates the user profile.
326
- *
327
- * @body UpdateUserProfileDto
328
- * @returns A response indicating the success of the update operation.
329
- */
335
+ * Updates the user profile.
336
+ *
337
+ * @body UpdateUserProfileDto
338
+ * @returns A response indicating the success of the update operation.
339
+ */
330
340
@Put ( '/' )
331
341
@ApiOperation ( {
332
342
summary : 'Update user profile' ,
@@ -343,48 +353,48 @@ export class UserController {
343
353
const userId = reqUser . id ;
344
354
updateUserProfileDto . id = userId ;
345
355
await this . userService . updateUserProfile ( updateUserProfileDto ) ;
346
-
356
+
347
357
const finalResponse : IResponse = {
348
358
statusCode : HttpStatus . OK ,
349
359
message : ResponseMessages . user . success . update
350
360
} ;
351
361
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
352
362
}
353
363
354
- /**
364
+ /**
355
365
* @body AddPasskeyDetailsDto
356
366
* @returns User's profile update status
357
367
*/
358
-
359
-
360
- @ Put ( '/password/:email' )
361
- @ ApiOperation ( { summary : 'Store user password details' , description : 'Securely store and update the user’s password details.' } )
362
- @ ApiExcludeEndpoint ( )
363
- @ ApiBearerAuth ( )
364
- @ UseGuards ( AuthGuard ( 'jwt' ) , UserAccessGuard )
365
-
366
- async addPasskey (
367
- @ Body ( ) userInfo : AddPasskeyDetailsDto ,
368
- @ User ( ) reqUser : user ,
369
- @ Res ( ) res : Response
370
- ) : Promise < Response > {
371
-
372
- const userDetails = await this . userService . addPasskey ( reqUser . email , userInfo ) ;
373
- const finalResponse = {
374
- statusCode : HttpStatus . OK ,
375
- message : ResponseMessages . user . success . update ,
376
- data : userDetails
377
- } ;
378
-
379
- return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
380
- }
368
+
369
+ @ Put ( '/password/:email' )
370
+ @ ApiOperation ( {
371
+ summary : 'Store user password details' ,
372
+ description : 'Securely store and update the user’s password details.'
373
+ } )
374
+ @ ApiExcludeEndpoint ( )
375
+ @ ApiBearerAuth ( )
376
+ @ UseGuards ( AuthGuard ( 'jwt' ) , UserAccessGuard )
377
+ async addPasskey (
378
+ @ Body ( ) userInfo : AddPasskeyDetailsDto ,
379
+ @ User ( ) reqUser : user ,
380
+ @ Res ( ) res : Response
381
+ ) : Promise < Response > {
382
+ const userDetails = await this . userService . addPasskey ( reqUser . email , userInfo ) ;
383
+ const finalResponse = {
384
+ statusCode : HttpStatus . OK ,
385
+ message : ResponseMessages . user . success . update ,
386
+ data : userDetails
387
+ } ;
388
+
389
+ return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
390
+ }
381
391
382
392
/**
383
- * Updates platform settings.
384
- * @body UpdatePlatformSettingsDto
385
- *
386
- * @returns Status of the update operation.
387
- */
393
+ * Updates platform settings.
394
+ * @body UpdatePlatformSettingsDto
395
+ *
396
+ * @returns Status of the update operation.
397
+ */
388
398
@Put ( '/platform-settings' )
389
399
@ApiOperation ( {
390
400
summary : 'Update platform settings' ,
@@ -406,4 +416,4 @@ export class UserController {
406
416
407
417
return res . status ( HttpStatus . OK ) . json ( finalResponse ) ;
408
418
}
409
- }
419
+ }
0 commit comments