-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Fetch user profile API #368
Conversation
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
@@ -69,6 +70,7 @@ export class UserController { | |||
* @returns Users list of organization | |||
*/ | |||
@Get('/public-profiles') | |||
@ApiExcludeEndpoint() | |||
@ApiResponse({ status: 200, description: 'Success', type: ApiResponseDto }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get status code from "HttpStatus" for example, for 200 we can use "HttpStatus.OK"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
@@ -9,16 +9,18 @@ import { UpdateUserProfileDto } from './dto/update-user-profile.dto'; | |||
import { AddPasskeyDetails } from './dto/add-user.dto'; | |||
import { UpdatePlatformSettingsDto } from './dto/update-platform-settings.dto'; | |||
import { CreateUserCertificateDto } from './dto/share-certificate.dto'; | |||
import { UsersProfile } from 'apps/user/interfaces/user.interface'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have consistency in interface names. We have decided to use "I" prefix and then interface name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
@@ -23,14 +23,35 @@ export interface Organisation { | |||
} | |||
|
|||
export interface UsersProfile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least one field should be mandatory. If there is an requirement for having all fields optional, let's discuss and finalize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
userId: string; | ||
orgRoleId: string; | ||
orgId: string; | ||
orgRole: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have OrgRole as an interface instead of object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
name: string; | ||
description: string; | ||
}; | ||
organisation: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
organization can be an interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
@@ -23,14 +23,35 @@ export interface Organisation { | |||
} | |||
|
|||
export interface UsersProfile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow naming convention for interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
userOrgRoles?: UserOrgRole[]; | ||
} | ||
|
||
interface UserOrgRole { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow naming convention for interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
@@ -48,7 +69,7 @@ export interface UsersProfile { | |||
username?: string; | |||
} | |||
|
|||
export interface userInfo { | |||
export interface UserInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow naming convention for interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
@@ -254,7 +254,7 @@ export class UserRepository { | |||
}); | |||
} | |||
|
|||
async findUserForPublicProfile(queryOptions: UserQueryOptions): Promise<UsersProfile> { | |||
async findUserForPublicProfile(queryOptions: UserQueryOptions): Promise<object> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we have replaced interface with object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have resolved this.
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
…nto error-handling-of-user-module
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
const payload = { userId, limit }; | ||
return this.sendNats(this.serviceProxy, 'get-user-activity', payload); | ||
return this.sendNatsMessage(this.serviceProxy, 'get-user-activity', payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep all the constants at one place and use in the application, enum can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with team, we can take this activity in upcoming sprint as this is a good to have practice.
/users/profile
and GET API/users/activity
What
Promise<object>
.How
Why