Skip to content

Commit

Permalink
Merge pull request #119 from credebl/register-user-details
Browse files Browse the repository at this point in the history
refactor: register user details
  • Loading branch information
nishad-ayanworks authored Oct 5, 2023
2 parents 169449b + 24d1c39 commit 0f13b5c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 19 deletions.
1 change: 1 addition & 0 deletions apps/agent-service/src/agent-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -888,5 +888,6 @@ export class AgentServiceService {
throw new RpcException(error.response ? error.response : error);
}
}

}

13 changes: 6 additions & 7 deletions apps/api-gateway/common/exception-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ export class CustomExceptionFilter extends BaseExceptionFilter {
if (exception && exception["response"] && exception.message) {

if (Array.isArray(exception["response"].message)) {
exception["response"].message.forEach((msg) => {
errorResponse = {
statusCode: exception["statusCode"] ? exception["statusCode"] : status,
message: msg || 'Internal server error',
error: msg || 'Internal server error'
};
});

errorResponse = {
statusCode: exception["statusCode"] ? exception["statusCode"] : status,
message: exception.message ? exception.message : 'Internal server error',
error: exception["response"].message ? exception["response"].message : exception["response"] ? exception["response"] : 'Internal server error'
};
} else {
errorResponse = {
statusCode: exception["statusCode"] ? exception["statusCode"] : status,
Expand Down
3 changes: 2 additions & 1 deletion apps/api-gateway/src/ecosystem/ecosystem.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { EditEcosystemDto } from './dtos/edit-ecosystem-dto';
import { AuthGuard } from '@nestjs/passport';
import { User } from '../authz/decorators/user.decorator';
import { BulkEcosystemInvitationDto } from './dtos/send-invitation.dto';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { user } from '@prisma/client';


@UseFilters(CustomExceptionFilter)
Expand Down Expand Up @@ -104,5 +106,4 @@ export class EcosystemController {
};
return res.status(HttpStatus.CREATED).json(finalResponse);
}

}
11 changes: 5 additions & 6 deletions apps/api-gateway/src/user/dto/add-user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ export class AddUserDetails {
@IsEmail()
@IsNotEmpty({ message: 'Please provide valid email' })
@IsString({ message: 'email should be string' })
@IsOptional()
email?: string;
email: string;

@ApiProperty({ example: 'Alen' })
@IsNotEmpty({ message: 'Please provide valid email' })
@IsString({ message: 'firstName should be string' })
@IsOptional()
firstName?: string;
firstName: string;

@ApiProperty({ example: 'Harvey' })
@IsNotEmpty({ message: 'Please provide valid email' })
@IsString({ message: 'lastName should be string' })
@IsOptional()
lastName?: string;
lastName: string;

@ApiProperty()
@Transform(({ value }) => trim(value))
Expand Down
1 change: 1 addition & 0 deletions apps/api-gateway/src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,5 @@ export class UserController {
return res.status(HttpStatus.OK).json(finalResponse);

}

}
3 changes: 1 addition & 2 deletions apps/organization/src/organization.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,5 +466,4 @@ export class OrganizationService {
throw new RpcException(error.response ? error.response : error);
}
}

}
}
1 change: 0 additions & 1 deletion apps/user/repositories/user-device.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,4 +288,3 @@ async addCredentialIdAndNameById(id:number, credentialId:string, deviceFriendlyN
}

}

1 change: 0 additions & 1 deletion libs/common/src/response-messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,5 @@ export const ResponseMessages = {
notCreated: 'Error while creating ecosystem',
update: 'Error while updating ecosystem'
}

},
};
1 change: 0 additions & 1 deletion libs/prisma-service/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,5 @@ model ecosystem_orgs {
lastChangedDateTime DateTime @default(now()) @db.Timestamptz(6)
lastChangedBy Int @default(1)
deletedAt DateTime? @db.Timestamp(6)
}

0 comments on commit 0f13b5c

Please sign in to comment.