-
Notifications
You must be signed in to change notification settings - Fork 26
Feat: adds lesson 26 , amiyah jones' MediaItemsController #626
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
Conversation
Accidentally removed my work the 1st time by merging
only failed test is simply for addItems where status expects 200 but is actually 400
return ResponseEntity.ok(response); | ||
} | ||
|
||
@PostMapping("/items") |
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.
My only error is that it expects the status 200 , but gets 400. Fixing this has been an issue
chatgpt expects me to manually include a book if statement , or a bindingResult <- both still gives the same 400 error.
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.
So you had two problems. For one, you were using the wrong @RequestBody
annotation so the request message was not being read correctly. Secondly, you should have preferred to accept the CreateMediaItemRequest
type which is the type of request the test anticipates sending.
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.
Got very close. Feel free to re-open and make changes if you wish, but closing for now.
return ResponseEntity.ok(response); | ||
} | ||
|
||
@PostMapping("/items") |
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.
So you had two problems. For one, you were using the wrong @RequestBody
annotation so the request message was not being read correctly. Secondly, you should have preferred to accept the CreateMediaItemRequest
type which is the type of request the test anticipates sending.
Implements the following:
GET /items
POST /items
GET /items/:id
DELETE /items/:id