Skip to content
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

feat: implement updatePost endpoint and modify datePosted handling #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mitchell-liatrio
Copy link

This pull request introduces several changes to the PostController and related files to add support for updating posts via a new PUT endpoint. Additionally, it includes modifications to the Post model and updates to the test suite to cover the new functionality.

Controller changes:

  • Added a new PUT endpoint to update posts in PostController with validation and error handling for date parsing and missing posts.

Model changes:

  • Changed the setDatePosted method in the Post model to accept a String instead of a Date to align with the new update functionality.

Test changes:

  • Added new test cases in PostControllerTest to cover successful updates, not found errors, and bad request errors for the new PUT endpoint.
  • Imported necessary Mockito and Spring test utilities in PostControllerTest to support the new test cases.

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.

1 participant