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

feat(language): Implement endpoint to fetch user languages #1340

Merged
merged 5 commits into from
Mar 1, 2025

Conversation

ricky-ultimate
Copy link
Contributor

@ricky-ultimate ricky-ultimate commented Mar 1, 2025

Pull Request

Description

This PR implements an API endpoint to retrieve all languages associated with a given user ID. The changes include:

  • Service Layer:

    • Added getUserLanguages(userId: string) method in LanguagesService.
    • Fetches languages associated with a user from the database.
    • Returns a 404 Not Found error if the user does not exist.
  • Controller Layer:

    • Introduced GET /users/:id/languages endpoint in LanguagesController.
    • Ensures only authenticated users can access the endpoint.
    • Implements proper error handling for invalid or non-existent user IDs.
  • Testing:

    • Added unit tests to validate successful retrieval of user languages.
    • Included tests for handling non-existent users.
    • Ensured repository interactions work as expected.

Related Issue

Fixes #1137
Fixes #1132

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation updates
  • style: Code style/formatting changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Test additions/updates
  • chore: Build process or tooling changes
  • ci: CI configuration changes
  • other:

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual tests

Test Evidence

Screenshot

Screenshots (if applicable)

Documentation Screenshots (if applicable)

Checklist

  • My code follows the project's coding style
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have included a screenshot showing all tests passing
  • I have included documentation screenshots (if applicable)

Additional Notes

@incredible-phoenix246 incredible-phoenix246 merged commit fad19fc into hngprojects:dev Mar 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants