Skip to content

Conversation

@AmiyahJo
Copy link
Contributor

Implements the following:

  • GET /items
  • POST /items
  • GET /items/:id
  • DELETE /items/:id

Accidentally removed my work the 1st time by merging
return ResponseEntity.ok(response);
}

@PostMapping("/items")
Copy link
Contributor Author

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.

Copy link
Contributor

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.

@AmiyahJo AmiyahJo marked this pull request as ready for review November 25, 2024 16:12
Copy link
Contributor

@anthonydmays anthonydmays left a 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")
Copy link
Contributor

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.

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