-
Notifications
You must be signed in to change notification settings - Fork 3
S25/teresa/matchmaking endpoints #111
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit ffa1530.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've kinda separated matchmaking services / functions unnecessarily
To make it a bit more intuitive, I'd suggest restructuring it like this:
Change endpoints:
- /matchmaking/users/:userId/pets ----> /users/match/:userId
- /matchmaking/pets/:petId/users ----> /pets/match/:petId
- get rid of /matchmaking router
Change services:
- matchmakingService.getMatchingUsersForPet(petId)
----> userService.getMatchingPetsForUser(userId) - matchmakingService.getMatchingPetsForUser(userId) ----> petService.getMatchingUsersForPet(petId)
- get rid of matchmakingService
backend/typescript/services/implementations/matchmakingService.ts
Outdated
Show resolved
Hide resolved
backend/typescript/rest/petRoutes.ts
Outdated
| const { userId } = req.params; | ||
|
|
||
| if (userId) { | ||
| if (typeof userId !== "string") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a middleware to handle the param validation will make this code a lot neater
See /middlewares/validators for examples of how other endpoints used it
-> create a matchPetsValidator function in petValidators
Do a similar process for /match/users/:petId
Artyom-G
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Notion ticket link
Matchmaking endpoints
Implementation description
Steps to test
no user found. similar message for pet
What should reviewers focus on?
Checklist