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

#429: Implement GET /subscription_user Endpoint #580

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

Tim-Quattrochi
Copy link
Contributor

Issue link / number:

#429

What changes did you make?

I created DTOs to define the structure of what will be sent/exchanged.

  • GetSubscriptionUserDto
  • GetSubscriptionUsersDto

I created a method in the SubscriptionUserService that returns all the subscriptions by a user id.

I created a method in the SubscriptionUserController that gets the authenticated user from the request. I used the req['UserEntity] instead of req['user'] because I seen in other issues that this will be the main way to retrieve the user. I then formatted the response to adhere to the requested structure in the issue.

Screenshot 2024-08-11 at 8 59 59 PM

Why did you make the changes?

The application wants to separate the users subscriptions from the /user/me endpoint, that way the client can request this /api/v1/subscription-user/subscription_user as needed to only retrieve the subscriptions.

Did you run tests?

I created and ran 2 unit tests in the existing subscription-user.spec.ts (Passing).

@eleanorreem
Copy link
Contributor

@Tim-Quattrochi sorry to be so slow to get to this! I am looking at this and your questions now. 😄

@eleanorreem
Copy link
Contributor

eleanorreem commented Aug 28, 2024

@Tim-Quattrochi this is great! Thanks! Just a couple tiny things and then we are good. Again sorry this took so long!

@Tim-Quattrochi
Copy link
Contributor Author

@Tim-Quattrochi sorry to be so slow to get to this! I am looking at this and your questions now. 😄

Thanks. I left a comment on the nested object dto. I pushed the abstraction of serializing data to utils.

@eleanorreem
Copy link
Contributor

@Tim-Quattrochi your question was a good one and thanks for your input! I can see the issue now that you were coming across. I hadn't realised the limitations of DTOs. That is my bad. Returning a mapped array is grand.

I have resolved the conflicts and deleted the extra DTO.

THanks again for your input ⭐

@eleanorreem eleanorreem merged commit 8ef5d9e into chaynHQ:develop Sep 10, 2024
3 checks passed
@eleanorreem eleanorreem self-requested a review September 10, 2024 16:52
@eleanorreem eleanorreem self-assigned this Sep 10, 2024
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.

2 participants