Skip to content

Commit

Permalink
Merge pull request #222 from souravbhowmik1999/statusChangeAdd
Browse files Browse the repository at this point in the history
User Management: Changes status field value
  • Loading branch information
vaivk369 authored Jun 20, 2024
2 parents dac21fc + 53cfa3b commit 4280f5c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/adapters/postgres/user-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class PostgresUserService implements IServicelocator {
INNER JOIN public."UserRolesMapping" UR
ON UR."userId" = U."userId"
INNER JOIN public."Roles" R
ON R."roleId" = UR."roleId" ${whereCondition} AND U."status"='true'`
ON R."roleId" = UR."roleId" ${whereCondition} AND U."status"='active'`
let results = await this.usersRepository.query(query);

if (!query) {
Expand Down Expand Up @@ -240,8 +240,8 @@ export class PostgresUserService implements IServicelocator {
return role;
}

async findUserDetails(userId, username?: any,tenantId?: string
){
async findUserDetails(userId, username?: any, tenantId?: string
) {
let whereClause: any = { userId: userId };
if (username && userId === null) {
delete whereClause.userId;
Expand All @@ -255,7 +255,7 @@ export class PostgresUserService implements IServicelocator {
return false;
}
const tenentDetails = await this.userTenantRoleData(userDetails.userId);
if(!tenentDetails) {
if (!tenentDetails) {
return userDetails;
}
const tenantData = tenantId ? tenentDetails.filter(item => item.tenantId === tenantId) : tenentDetails;
Expand All @@ -280,9 +280,8 @@ export class PostgresUserService implements IServicelocator {
WHERE
UTM."userId" = $1
ORDER BY
T."tenantId", UTM."Id";
`;

T."tenantId", UTM."Id";`;

const result = await this.usersRepository.query(query, [userId]);
const combinedResult = [];
let roleArray = []
Expand Down

0 comments on commit 4280f5c

Please sign in to comment.