From e512b8372f1a2ae797155b6428f764ef8f3f1b9b Mon Sep 17 00:00:00 2001 From: souravbhowmik1999 Date: Tue, 14 Jan 2025 16:02:43 +0530 Subject: [PATCH 1/6] PS-3323: Adding New Fields from the backend --- src/adapters/postgres/user-adapter.ts | 64 +++++++++++++++-------- src/common/utils/keycloak.adapter.util.ts | 18 +++---- src/user/dto/user-create.dto.ts | 34 +++++++++++- src/user/dto/user-update.dto.ts | 31 ++++++++++- src/user/entities/user-entity.ts | 13 ++++- 5 files changed, 120 insertions(+), 40 deletions(-) diff --git a/src/adapters/postgres/user-adapter.ts b/src/adapters/postgres/user-adapter.ts index e3b2531e..f36562d5 100644 --- a/src/adapters/postgres/user-adapter.ts +++ b/src/adapters/postgres/user-adapter.ts @@ -404,7 +404,7 @@ export class PostgresUserService implements IServicelocator { whereCondition += ` AND `; } if (userKeys.includes(key)) { - if (key === "name") { + if (key === "firstName") { whereCondition += ` U."${key}" ILIKE '%${value}%'`; } else { if (key === "status" || key === "email") { @@ -498,7 +498,7 @@ export class PostgresUserService implements IServicelocator { } //Get user core fields data - const query = `SELECT U."userId", U."username",U."email", U."name", R."name" AS role, U."mobile", U."createdBy",U."updatedBy", U."createdAt", U."updatedAt", U.status, COUNT(*) OVER() AS total_count + const query = `SELECT U."userId", U."username",U."email", U."firstName", U."middleName", U."lastName", U.gender, R."name" AS role, U."mobile", U."createdBy",U."updatedBy", U."createdAt", U."updatedAt", U.status, COUNT(*) OVER() AS total_count FROM public."Users" U LEFT JOIN public."CohortMembers" CM ON CM."userId" = U."userId" @@ -688,7 +688,9 @@ export class PostgresUserService implements IServicelocator { select: [ "userId", "username", - "name", + "firstName", + "middleName", + "lastName", "mobile", "email", "temporaryPassword", @@ -900,16 +902,35 @@ export class PostgresUserService implements IServicelocator { return deviceIds; } - async updateBasicUserDetails(userId, userData: Partial): Promise { - const user = await this.usersRepository.findOne({ - where: { userId: userId }, - }); - if (!user) { - return null; + async updateBasicUserDetails(userId: string, userData: Partial): Promise { + try { + // Fetch the user by ID + const user = await this.usersRepository.findOne({ where: { userId } }); + + if (!user) { + // If the user is not found, return null + return null; + } + + console.log(userId, userData); + + // Update the user's details + await this.usersRepository.update(userId, userData); + + // Fetch and return the updated user + const updatedUser = await this.usersRepository.findOne({ where: { userId } }); + + return updatedUser; + } catch (error) { + // Log the error for debugging purposes + console.error('Error updating user details:', error); + + // Re-throw or handle the error as needed + throw new Error('An error occurred while updating user details'); } - Object.assign(user, userData); - return this.usersRepository.save(user); } + + async createUser( request: any, @@ -987,7 +1008,7 @@ export class PostgresUserService implements IServicelocator { HttpStatus.BAD_REQUEST ); } - + resKeycloak = await createUserInKeyCloak(userSchema, token).catch( (error) => { LoggerUtil.error( @@ -1008,6 +1029,7 @@ export class PostgresUserService implements IServicelocator { ); LoggerUtil.log(API_RESPONSES.USER_CREATE_KEYCLOAK, apiId); + userCreateDto.userId = resKeycloak; @@ -1083,7 +1105,7 @@ export class PostgresUserService implements IServicelocator { HttpStatus.CREATED, API_RESPONSES.USER_CREATE_SUCCESSFULLY ); - } catch (e) { + } catch (e) { LoggerUtil.error( `${API_RESPONSES.SERVER_ERROR}: ${request.url}`, `Error: ${e.message}`, @@ -1294,17 +1316,15 @@ export class PostgresUserService implements IServicelocator { response: Response ) { const user = new User(); - (user.username = userCreateDto?.username), - (user.name = userCreateDto?.name), + (user.userId = userCreateDto?.userId), + (user.username = userCreateDto?.username), + (user.firstName = userCreateDto?.firstName), + (user.middleName = userCreateDto?.middleName), + (user.lastName = userCreateDto?.lastName), + (user.gender = userCreateDto?.gender), (user.email = userCreateDto?.email), (user.mobile = Number(userCreateDto?.mobile) || null), - (user.createdBy = userCreateDto?.createdBy || userCreateDto?.userId), - (user.updatedBy = userCreateDto?.updatedBy || userCreateDto?.userId), - (user.userId = userCreateDto?.userId), - (user.state = userCreateDto?.state), - (user.district = userCreateDto?.district), - (user.address = userCreateDto?.address), - (user.pincode = userCreateDto?.pincode); + (user.createdBy = userCreateDto?.createdBy || userCreateDto?.createdBy); if (userCreateDto?.dob) { user.dob = new Date(userCreateDto.dob); diff --git a/src/common/utils/keycloak.adapter.util.ts b/src/common/utils/keycloak.adapter.util.ts index a86547cd..12a912f0 100644 --- a/src/common/utils/keycloak.adapter.util.ts +++ b/src/common/utils/keycloak.adapter.util.ts @@ -55,22 +55,14 @@ async function getKeycloakAdminToken() { async function createUserInKeyCloak(query, token) { const axios = require("axios"); - const name = query.name; - const nameParts = name.split(" "); - let lname = ""; - - if (nameParts[2]) { - lname = nameParts[2]; - } else if (nameParts[1]) { - lname = nameParts[1]; - } + if (!query.password) { return "User cannot be created, Password missing"; } - + const data = JSON.stringify({ - firstName: nameParts[0], - lastName: lname, + firstName: query.firstName, + lastName: query.lastName, enabled: "true", username: query.username, // groups: [getUserGroup(query.role)], @@ -92,6 +84,8 @@ async function createUserInKeyCloak(query, token) { }, data: data, }; + console.log("hhhhhh"); + let userResponse; // try { // userResponse = await axios(config); diff --git a/src/user/dto/user-create.dto.ts b/src/user/dto/user-create.dto.ts index 3a077c0c..8e09da65 100644 --- a/src/user/dto/user-create.dto.ts +++ b/src/user/dto/user-create.dto.ts @@ -9,6 +9,8 @@ import { IsUUID, ValidateNested, IsOptional, + Length, + IsEnum, } from "class-validator"; import { User } from "../entities/user-entity"; import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger"; @@ -70,9 +72,37 @@ export class UserCreateDto { @IsNotEmpty() username: string; - @ApiProperty({ type: () => String }) + @ApiProperty({ type: String, description: 'First name of the user', maxLength: 50 }) + @Expose() + @IsString() + @Length(1, 50) + firstName: string; + + @ApiPropertyOptional({ type: String, description: 'Middle name of the user (optional)', maxLength: 50, required: false }) + @Expose() + @IsOptional() + @IsString() + @Length(0, 50) + middleName?: string; + + @ApiProperty({ type: String, description: 'Last name of the user', maxLength: 50 }) @Expose() - name: string; + @IsString() + @Length(1, 50) + lastName: string; + + @Expose() + name:string; + + @ApiProperty({ + type: String, + description: 'Gender of the user', + enum: ['male', 'female', 'transgender'] + }) + @Expose() + @IsEnum(['male', 'female', 'transgender']) + gender: string; + @ApiPropertyOptional({ type: String, diff --git a/src/user/dto/user-update.dto.ts b/src/user/dto/user-update.dto.ts index 4ec0b243..3bbe37df 100644 --- a/src/user/dto/user-update.dto.ts +++ b/src/user/dto/user-update.dto.ts @@ -6,6 +6,7 @@ import { IsNotEmpty, IsEnum, ValidateIf, + Length, } from "class-validator"; import { Expose, Type } from "class-transformer"; import { UserStatus } from "../entities/user-entity"; @@ -22,10 +23,36 @@ class UserDataDTO { @IsOptional() username: string; - @ApiProperty({ type: () => String }) + @ApiProperty({ type: String, description: 'First name of the user', maxLength: 50 }) + @Expose() + @IsOptional() + @IsString() + @Length(1, 50) + firstName?: string; + + @ApiProperty({ type: String, description: 'Middle name of the user (optional)', maxLength: 50, required: false }) + @Expose() + @IsOptional() @IsString() + @Length(0, 50) + middleName?: string; + + @ApiProperty({ type: String, description: 'Last name of the user', maxLength: 50 }) + @Expose() + @IsOptional() + @IsString() + @Length(1, 50) + lastName?: string; + + @ApiProperty({ + type: String, + description: 'Gender of the user', + enum: ['male', 'female', 'transgender'] + }) + @Expose() + @IsEnum(['male', 'female', 'transgender']) @IsOptional() - name: string; + gender?: string; @ApiProperty({ type: () => String }) @IsString() diff --git a/src/user/entities/user-entity.ts b/src/user/entities/user-entity.ts index c0233bd5..bbca3e25 100644 --- a/src/user/entities/user-entity.ts +++ b/src/user/entities/user-entity.ts @@ -22,8 +22,17 @@ export class User { @Column({ unique: true }) username: string; - @Column() - name: string; + @Column({ type: 'varchar', length: 50, nullable: false }) + firstName: string; + + @Column({ type: 'varchar', length: 50, nullable: true }) + middleName: string; + + @Column({ type: 'varchar', length: 50, nullable: false }) + lastName: string; + + @Column({ type: 'enum', enum: ['male', 'female', 'transgender'], nullable: false }) + gender: string; @Column({ type: "date", nullable: true }) dob: Date; From 2bb4709bb3ac0dc5270f3ccb6dddf7e09f3c4f47 Mon Sep 17 00:00:00 2001 From: souravbhowmik1999 Date: Tue, 14 Jan 2025 16:08:02 +0530 Subject: [PATCH 2/6] remove comented code --- src/adapters/postgres/user-adapter.ts | 11 +++-------- src/common/utils/keycloak.adapter.util.ts | 6 ++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/adapters/postgres/user-adapter.ts b/src/adapters/postgres/user-adapter.ts index f36562d5..406e0a89 100644 --- a/src/adapters/postgres/user-adapter.ts +++ b/src/adapters/postgres/user-adapter.ts @@ -498,7 +498,7 @@ export class PostgresUserService implements IServicelocator { } //Get user core fields data - const query = `SELECT U."userId", U."username",U."email", U."firstName", U."middleName", U."lastName", U.gender, R."name" AS role, U."mobile", U."createdBy",U."updatedBy", U."createdAt", U."updatedAt", U.status, COUNT(*) OVER() AS total_count + const query = `SELECT U."userId", U."username",U."email", U."firstName", U."middleName", U."lastName", U.gender, U.dob, R."name" AS role, U."mobile", U."createdBy",U."updatedBy", U."createdAt", U."updatedAt", U.status, COUNT(*) OVER() AS total_count FROM public."Users" U LEFT JOIN public."CohortMembers" CM ON CM."userId" = U."userId" @@ -911,9 +911,7 @@ export class PostgresUserService implements IServicelocator { // If the user is not found, return null return null; } - - console.log(userId, userData); - + // Update the user's details await this.usersRepository.update(userId, userData); @@ -921,10 +919,7 @@ export class PostgresUserService implements IServicelocator { const updatedUser = await this.usersRepository.findOne({ where: { userId } }); return updatedUser; - } catch (error) { - // Log the error for debugging purposes - console.error('Error updating user details:', error); - + } catch (error) { // Re-throw or handle the error as needed throw new Error('An error occurred while updating user details'); } diff --git a/src/common/utils/keycloak.adapter.util.ts b/src/common/utils/keycloak.adapter.util.ts index 12a912f0..26ee88bb 100644 --- a/src/common/utils/keycloak.adapter.util.ts +++ b/src/common/utils/keycloak.adapter.util.ts @@ -59,7 +59,7 @@ async function createUserInKeyCloak(query, token) { if (!query.password) { return "User cannot be created, Password missing"; } - + const data = JSON.stringify({ firstName: query.firstName, lastName: query.lastName, @@ -83,9 +83,7 @@ async function createUserInKeyCloak(query, token) { Authorization: "Bearer " + token, }, data: data, - }; - console.log("hhhhhh"); - + }; let userResponse; // try { // userResponse = await axios(config); From d8a04e7a978cfd563c27340fd56f8ec5c6fffb15 Mon Sep 17 00:00:00 2001 From: souravbhowmik1999 Date: Tue, 14 Jan 2025 17:43:19 +0530 Subject: [PATCH 3/6] removename field from dto --- src/user/dto/user-create.dto.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/user/dto/user-create.dto.ts b/src/user/dto/user-create.dto.ts index 8e09da65..4e6c1dd8 100644 --- a/src/user/dto/user-create.dto.ts +++ b/src/user/dto/user-create.dto.ts @@ -91,9 +91,6 @@ export class UserCreateDto { @Length(1, 50) lastName: string; - @Expose() - name:string; - @ApiProperty({ type: String, description: 'Gender of the user', From 38bf4f95fa406b325d569df59efd6e84bc7838ad Mon Sep 17 00:00:00 2001 From: souravbhowmik1999 Date: Wed, 15 Jan 2025 11:51:17 +0530 Subject: [PATCH 4/6] coderabbitai comment resolved --- src/adapters/postgres/user-adapter.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/adapters/postgres/user-adapter.ts b/src/adapters/postgres/user-adapter.ts index 406e0a89..dd7807af 100644 --- a/src/adapters/postgres/user-adapter.ts +++ b/src/adapters/postgres/user-adapter.ts @@ -498,7 +498,7 @@ export class PostgresUserService implements IServicelocator { } //Get user core fields data - const query = `SELECT U."userId", U."username",U."email", U."firstName", U."middleName", U."lastName", U.gender, U.dob, R."name" AS role, U."mobile", U."createdBy",U."updatedBy", U."createdAt", U."updatedAt", U.status, COUNT(*) OVER() AS total_count + const query = `SELECT U."userId", U."username",U."email", U."firstName", U."middleName", U."lastName", U."gender", U."dob", R."name" AS role, U."mobile", U."createdBy",U."updatedBy", U."createdAt", U."updatedAt", U.status, COUNT(*) OVER() AS total_count FROM public."Users" U LEFT JOIN public."CohortMembers" CM ON CM."userId" = U."userId" @@ -1311,15 +1311,15 @@ export class PostgresUserService implements IServicelocator { response: Response ) { const user = new User(); - (user.userId = userCreateDto?.userId), - (user.username = userCreateDto?.username), - (user.firstName = userCreateDto?.firstName), - (user.middleName = userCreateDto?.middleName), - (user.lastName = userCreateDto?.lastName), - (user.gender = userCreateDto?.gender), - (user.email = userCreateDto?.email), - (user.mobile = Number(userCreateDto?.mobile) || null), - (user.createdBy = userCreateDto?.createdBy || userCreateDto?.createdBy); + user.userId = userCreateDto?.userId, + user.username = userCreateDto?.username, + user.firstName = userCreateDto?.firstName, + user.middleName = userCreateDto?.middleName, + user.lastName = userCreateDto?.lastName, + user.gender = userCreateDto?.gender, + user.email = userCreateDto?.email, + user.mobile = Number(userCreateDto?.mobile) || null, + user.createdBy = userCreateDto?.createdBy || userCreateDto?.createdBy; if (userCreateDto?.dob) { user.dob = new Date(userCreateDto.dob); From ea303be744e114123804dccb20eb38b9c9e5257f Mon Sep 17 00:00:00 2001 From: souravbhowmik1999 Date: Wed, 15 Jan 2025 12:26:14 +0530 Subject: [PATCH 5/6] Add email on keycloak --- src/common/utils/keycloak.adapter.util.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/utils/keycloak.adapter.util.ts b/src/common/utils/keycloak.adapter.util.ts index 26ee88bb..c86af71a 100644 --- a/src/common/utils/keycloak.adapter.util.ts +++ b/src/common/utils/keycloak.adapter.util.ts @@ -63,6 +63,7 @@ async function createUserInKeyCloak(query, token) { const data = JSON.stringify({ firstName: query.firstName, lastName: query.lastName, + email: query.email ? query.email : null, enabled: "true", username: query.username, // groups: [getUserGroup(query.role)], From 3177f36df583a1cb20f2003a75ff8dac4f08d650 Mon Sep 17 00:00:00 2001 From: souravbhowmik1999 Date: Thu, 16 Jan 2025 14:30:56 +0530 Subject: [PATCH 6/6] add --- src/adapters/postgres/user-adapter.ts | 55 ++++++++++-------- src/common/utils/keycloak.adapter.util.ts | 71 +++++++++++++++-------- src/common/utils/response.messages.ts | 1 + src/user/user.controller.ts | 3 +- 4 files changed, 79 insertions(+), 51 deletions(-) diff --git a/src/adapters/postgres/user-adapter.ts b/src/adapters/postgres/user-adapter.ts index dd7807af..a51d57ca 100644 --- a/src/adapters/postgres/user-adapter.ts +++ b/src/adapters/postgres/user-adapter.ts @@ -69,8 +69,6 @@ export class PostgresUserService implements IServicelocator { private tenantsRepository: Repository, @InjectRepository(UserRoleMapping) private userRoleMappingRepository: Repository, - @InjectRepository(Cohort) - private cohortRepository: Repository, @InjectRepository(Role) private roleRepository: Repository, private fieldsService: PostgresFieldsService, @@ -906,26 +904,26 @@ export class PostgresUserService implements IServicelocator { try { // Fetch the user by ID const user = await this.usersRepository.findOne({ where: { userId } }); - + if (!user) { // If the user is not found, return null return null; } - + // Update the user's details await this.usersRepository.update(userId, userData); - + // Fetch and return the updated user const updatedUser = await this.usersRepository.findOne({ where: { userId } }); - + return updatedUser; - } catch (error) { + } catch (error) { // Re-throw or handle the error as needed throw new Error('An error occurred while updating user details'); } } - - + + async createUser( request: any, @@ -986,7 +984,7 @@ export class PostgresUserService implements IServicelocator { const userSchema = new UserCreateDto(userCreateDto); let errKeycloak = ""; - let resKeycloak = ""; + let resKeycloak; const keycloakResponse = await getKeycloakAdminToken(); const token = keycloakResponse.data.access_token; @@ -1003,30 +1001,37 @@ export class PostgresUserService implements IServicelocator { HttpStatus.BAD_REQUEST ); } - - resKeycloak = await createUserInKeyCloak(userSchema, token).catch( - (error) => { - LoggerUtil.error( - `${API_RESPONSES.SERVER_ERROR}: ${request.url}`, - `KeyCloak Error: ${error.message}`, - apiId - ); - errKeycloak = error.response?.data.errorMessage; + resKeycloak = await createUserInKeyCloak(userSchema, token) + + + if(resKeycloak.statusCode !== 201 ){ + if (resKeycloak.statusCode === 409) { + LoggerUtil.log(API_RESPONSES.EMAIL_EXIST, apiId); + + return APIResponse.error( + response, + apiId, + API_RESPONSES.EMAIL_EXIST, + `${resKeycloak.message} ${resKeycloak.email}`, + HttpStatus.CONFLICT + ); + }else{ + LoggerUtil.log(API_RESPONSES.SERVER_ERROR, apiId); return APIResponse.error( response, apiId, API_RESPONSES.SERVER_ERROR, - `${errKeycloak}`, + `${resKeycloak.message}`, HttpStatus.INTERNAL_SERVER_ERROR ); } - ); + } LoggerUtil.log(API_RESPONSES.USER_CREATE_KEYCLOAK, apiId); - - userCreateDto.userId = resKeycloak; + + userCreateDto.userId = resKeycloak.userId; // if cohort given then check for academic year @@ -1100,7 +1105,7 @@ export class PostgresUserService implements IServicelocator { HttpStatus.CREATED, API_RESPONSES.USER_CREATE_SUCCESSFULLY ); - } catch (e) { + } catch (e) { LoggerUtil.error( `${API_RESPONSES.SERVER_ERROR}: ${request.url}`, `Error: ${e.message}`, @@ -1311,7 +1316,7 @@ export class PostgresUserService implements IServicelocator { response: Response ) { const user = new User(); - user.userId = userCreateDto?.userId, + user.userId = userCreateDto?.userId, user.username = userCreateDto?.username, user.firstName = userCreateDto?.firstName, user.middleName = userCreateDto?.middleName, diff --git a/src/common/utils/keycloak.adapter.util.ts b/src/common/utils/keycloak.adapter.util.ts index c86af71a..848cb0a9 100644 --- a/src/common/utils/keycloak.adapter.util.ts +++ b/src/common/utils/keycloak.adapter.util.ts @@ -1,5 +1,7 @@ import { API_RESPONSES } from "./response.messages"; import { LoggerUtil } from "src/common/logger/LoggerUtil"; +const axios = require("axios"); + function getUserRole(userRoles: string[]) { if (userRoles.includes("systemAdmin")) { return "systemAdmin"; @@ -53,9 +55,8 @@ async function getKeycloakAdminToken() { return res; } -async function createUserInKeyCloak(query, token) { - const axios = require("axios"); +async function createUserInKeyCloak(query, token) { if (!query.password) { return "User cannot be created, Password missing"; } @@ -63,48 +64,70 @@ async function createUserInKeyCloak(query, token) { const data = JSON.stringify({ firstName: query.firstName, lastName: query.lastName, - email: query.email ? query.email : null, - enabled: "true", + email: query.email || null, // Use `||` for simpler null/undefined handling username: query.username, - // groups: [getUserGroup(query.role)], + enabled: true, // Changed "true" (string) to true (boolean) credentials: [ { - temporary: "false", + temporary: false, // Changed "false" (string) to false (boolean) type: "password", value: query.password, }, ], }); + console.log("Payload for Keycloak:", data); + const config = { method: "post", - url: process.env.KEYCLOAK + process.env.KEYCLOAK_ADMIN, + url: `${process.env.KEYCLOAK}${process.env.KEYCLOAK_ADMIN}`, headers: { "Content-Type": "application/json", - Authorization: "Bearer " + token, + Authorization: `Bearer ${token}`, }, - data: data, - }; - let userResponse; - // try { - // userResponse = await axios(config); - // } catch (e) { - // return e; - // } - - // const userString = userResponse.headers.location; - // const index = userString.lastIndexOf("/"); - // const userId = userString.substring(index + 1); + data, + }; - // return userId; try { - const userResponse = await axios(config); - return userResponse.headers.location.split("/").pop(); + // Make the request and wait for the response + const response = await axios(config); + + // Log and return the created user's ID + console.log("User created successfully:", response.data); + const userId = response.headers.location.split("/").pop(); // Extract user ID from the location header + console.log("Created User ID:", userId); + return { statusCode: response.status, message: "User created successfully", userId : userId }; } catch (error) { - return "Error creating user: " + error.response.data.error; + // Handle errors and log relevant details + if (error.response) { + console.error("Error Response Status:", error.response.status); + console.error("Error Response Data:", error.response.data); + console.error("Error Response Headers:", error.response.headers); + + return { + statusCode: error.response.status, + message: error.response.data.errorMessage || "Error occurred during user creation", + email: query.email || "No email provided", + }; + } else if (error.request) { + console.error("No response received:", error.request); + return { + statusCode: 500, + message: "No response received from Keycloak", + email: query.email || "No email provided", + }; + } else { + console.error("Error setting up request:", error.message); + return { + statusCode: 500, + message: `Error setting up request: ${error.message}`, + email: query.email || "No email provided", + }; + } } } + async function checkIfEmailExistsInKeycloak(email, token) { const axios = require("axios"); const config = { diff --git a/src/common/utils/response.messages.ts b/src/common/utils/response.messages.ts index 1e1e8647..992af67b 100644 --- a/src/common/utils/response.messages.ts +++ b/src/common/utils/response.messages.ts @@ -1,5 +1,6 @@ export const API_RESPONSES = { USERNAME_NOT_FOUND: "Username does not exist", + EMAIL_EXIST: "Email already exists", USER_NOT_FOUND: "User does not exist", FORGOT_PASSWORD_SUCCESS: "Forgot password Reset successfully", EMAIL_NOT_FOUND_FOR_RESET: diff --git a/src/user/user.controller.ts b/src/user/user.controller.ts index 1532d230..65f49df9 100644 --- a/src/user/user.controller.ts +++ b/src/user/user.controller.ts @@ -155,7 +155,6 @@ export class UserController { public async updateUser( @Headers() headers, @Param("userid") userId: string, - @Req() request: Request, @Body() userUpdateDto: UserUpdateDTO, @Res() response: Response ) { @@ -163,7 +162,7 @@ export class UserController { userUpdateDto.userId = userId; return await this.userAdapter .buildUserAdapter() - .updateUser(userUpdateDto, response); + .updateUser( userUpdateDto, response); } @UseFilters(new AllExceptionsFilter(APIID.USER_LIST))