-
Notifications
You must be signed in to change notification settings - Fork 5
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
Features/team resources endpoints #27
Conversation
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.
you can run yarn format
to fix lint errors
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.
LGTM - great job taking in all comments and incorporating them into your code.
I tested endpoints locally.
Endpoints should be plural - we will take care of that in another task
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.
Reviewed changes - looks good.
I tested 2 more random API endpoints within team resources to make sure they work as expected.
Only outstanding is the userId within body of resource DTO - will this be removed once auth is in?
That's correct. I haven't looked into this in detail but I think it'd be good to name the folder voyage resources or something like that since we have this resources and the global resources. Idk what naming convention be team decided on but it looks like there's another folder using kebab casing, so voyage-resources? Something like that. |
yes nestjs use kebab case for files and folders |
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.
I see you are solely using teamMemberId, in this case, userId won't be required at all. But I've explained why I believe using userId + team Id to find teamMemberId in the backend would be better in another 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.
LGTM
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.
Changed approved
Tested each of the endpoints and they are working an protect for creator only edits when required. |
Do we want to consider having a validator that a url is bring input? It looks like prisma does work with regex and other options. https://www.prisma.io/docs/concepts/components/prisma-client/custom-validation |
nestjs has a |
Looks good but missing some basic error handling for the POST and GET, like if TeamId doesn't exist it just returns a generic 500 error. I also agree to adding something to validate it's a url, you could look at nestjs built in and for GET, if the team doesn't exist it returns [] which should probably return an error, as opposed to returning [] when there's actually no votes |
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.
lgtm
We can always add error-handling in later especially when other api controllers will also need error-handling.
Description
Create endpoints for team resources
Issue link
Fixes # 18
Type of change
How Has This Been Tested?
Tested with Swagger and Postman.
Checklist: