Repository navigation
Create Resource Methods in Controller and Service - #34
Conversation
|
@rayyanmridha yeah these defaults are fine; we still don't have specifics on scoring so whatever defaults we choose now are probably going to change anyway. |
SamNie2027
left a comment
There was a problem hiding this comment.
Everything looks good. I just have that one comment about changing the default to 200 OK, I think it should be 201 created
| * or 500 with a descriptive message if the resource can't be saved to the database. | ||
| */ | ||
| @Post() | ||
| @HttpCode(HttpStatus.OK) |
There was a problem hiding this comment.
Curious why you changed the default to 200 OK instead of 201 Created?
There was a problem hiding this comment.
In the acceptance criteria it said creating a resource should return 200
There was a problem hiding this comment.
Ah, then that is on me. I will do the change.
|
Given you've requested Camila as a reviewer, I'm not sure if you would want Camila to review before merging so I am going to leave that up to you to merge |
ℹ️ Issue
Closes #16
📝 Description
Made some create methods for the service and controller that makes a new resource. The Post endpoint in the controller calls upon the service methods to create the new DTO for resource that safeguard field types.
✔️ Verification
Rejection Test:

Success Test with SQL table in the background:

🏕️ (Optional) Future Work / Notes
There are some required fields such as the score, vetting status, and last verified date that I added placeholder values for when creating a resource.
@SamNie2027 confirm if these are fine for now and if we should change them in the future.