Skip to content
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 user and auth module APIs #377

Merged
merged 7 commits into from
Dec 27, 2023

Conversation

pranalidhanavade
Copy link
Contributor

@pranalidhanavade pranalidhanavade commented Dec 26, 2023

  • Refactored following APIs:
  1. GET API /auth/verify to Verify user’s email.
  2. POST API/auth/verification-mail to Send verification mail.
  3. GET API /users/{email} to Check user exist.

What

  1. Implemented a well-defined interface by replacing previous existing Promise<object>.
  2. Ensured consistency of API status codes.
  3. Modified the NATS function.
  4. Tested with both positive and negative scenarios.

How

  1. Replaced the return type with a well-defined interface to enhance code clarity.
  2. Checked and standardized API status codes to ensure a uniform response.
  3. Modified the NATS function to accommodate the adjustments made in the API.

Why

  1. The implementation of a well-defined interface enhances code readability and makes the structure of the API response more explicit.
  2. Ensuring consistent API status codes improves communication between different components of the system and enhances overall reliability.

@pranalidhanavade pranalidhanavade changed the title Refactor auth module api Refactor user and module APIs Dec 26, 2023
@@ -243,8 +243,7 @@ export class UserController {
/**
*
* @param email
* @param res
* @returns User email check
* @returns User's email exist status
*/
@Get('/:email')
@ApiOperation({ summary: 'Check user exist', description: 'check user existence' })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace summary and description with "Check if user exists"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

private readonly logger: Logger
) {}

/**
*
* @param userEmailVerificationDto
* @param userEmailVerification
* @returns user email
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with "User's email"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

Signed-off-by: pranalidhanavade <[email protected]>
Copy link

sonarcloud bot commented Dec 27, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@pranalidhanavade pranalidhanavade changed the title Refactor user and module APIs Refactor user and auth module APIs Dec 27, 2023
@vivekayanworks vivekayanworks merged commit 861b171 into nats-refactor Dec 27, 2023
2 checks passed
@vivekayanworks vivekayanworks deleted the refactor-auth-module-api branch December 27, 2023 10:36
@pranalidhanavade pranalidhanavade linked an issue Dec 28, 2023 that may be closed by this pull request
14 tasks
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error handling for APIs of User, Auth modules
2 participants