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

Class TutorialController @PostMapping createTutorial Logic Bug #1

Open
DakotaCS opened this issue Mar 15, 2022 · 0 comments
Open

Class TutorialController @PostMapping createTutorial Logic Bug #1

DakotaCS opened this issue Mar 15, 2022 · 0 comments

Comments

@DakotaCS
Copy link

Fiddling around with this project for work, The TutorialController.java @PostMapping createTutorial function contains a logic bug.
TutorialController.java, Line 66-67 will always force the published bool to be false:
Tutorial _tutorial = tutorialRepository
.save(new Tutorial(tutorial.getTitle(), tutorial.getDescription(), false));

This in my opinion should be updated to:
Tutorial _tutorial = tutorialRepository.save(new Tutorial
(tutorial.getTitle(), tutorial.getDescription(), tutorial.isPublished()));

For big datasets this will corrupt your "published" boolean column and will result in one having to manually run SQL commands to update your dataset should you choose to hook it to a localdb.

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

No branches or pull requests

1 participant