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

chore: Add PUT endpoint for updating posts #14

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

Conversation

jallen2112
Copy link

This pull request includes a significant update to the PostController.java file. The change introduces a new endpoint that allows for updating existing posts or creating a new post if the specified post does not exist.

  • src/main/java/com/liatrio/dojo/devopsknowledgeshareapi/PostController.java: Added a new @PutMapping annotated method putPosts(). This method receives a PUT request with a post id and a newPost object. If the id exists, it updates the corresponding post's title and content with the information from newPost and saves it to the repository. If the id does not exist, it sets the id of newPost and saves newPost to the repository.

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