Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/user/dto/user-search.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class setFilters {
@IsOptional()
@IsArray()
@IsNotEmpty({ each: true })
@IsUUID(undefined, { each: true })
@IsString({ each: true })
userId?: string[]; //This is dynamically used in db query

@ApiPropertyOptional({
Expand Down Expand Up @@ -116,7 +116,7 @@ export class excludeFields {
@IsOptional()
@IsArray()
@IsNotEmpty({ each: true })
@IsUUID(undefined, { each: true })
@IsString({ each: true })
userIds?: string[];

@ApiProperty({
Expand Down
2 changes: 1 addition & 1 deletion src/user/entities/user-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum UserStatus {

@Entity({ name: "Users" })
export class User {
@PrimaryColumn({ type: "uuid" })
@PrimaryColumn({ type: "varchar" })
userId: string;

@Column({ unique: true })
Expand Down
4 changes: 2 additions & 2 deletions src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class UserController {
@Headers() headers,
@Req() request: Request,
@Res() response: Response,
@Param("userId", ParseUUIDPipe) userId: string,
@Param("userId") userId: string,
@Query("fieldvalue") fieldvalue: string | null = null
) {
const tenantId = headers["tenantid"];
Expand Down Expand Up @@ -166,7 +166,7 @@ export class UserController {
public async updateUser(
@Headers() headers,
@Param("userid") userId: string,
@GetUserId("loginUserId", ParseUUIDPipe) loginUserId: string,
@GetUserId("loginUserId") loginUserId: string,
@Body() userUpdateDto: UserUpdateDTO,
@Res() response: Response
) {
Expand Down
18 changes: 9 additions & 9 deletions src/user/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,15 +973,15 @@
async getUsersDetailsById(userData: UserData, response: any) {
const apiId = APIID.USER_GET;
try {
if (!isUUID(userData.userId)) {
return APIResponse.error(
response,
apiId,
API_RESPONSES.BAD_REQUEST,
`Error: ${API_RESPONSES.UUID_VALIDATION}`,
HttpStatus.BAD_REQUEST
);
}
// if (!isUUID(userData.userId)) {
// return APIResponse.error(
// response,
// apiId,
// API_RESPONSES.BAD_REQUEST,
// `Error: ${API_RESPONSES.UUID_VALIDATION}`,
// HttpStatus.BAD_REQUEST
// );
// }

Check warning on line 984 in src/user/user.service.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this commented out code.

See more on https://sonarcloud.io/project/issues?id=tekdi_user-microservice&issues=AZ2qqf9JokeycrwjO4a_&open=AZ2qqf9JokeycrwjO4a_&pullRequest=724
const checkExistUser = await this.usersRepository.find({
where: {
userId: userData.userId,
Expand Down