spring-boot-sql-server icon indicating copy to clipboard operation
spring-boot-sql-server copied to clipboard

Class TutorialController @PostMapping createTutorial Logic Bug

Open DakotaCS opened this issue 3 years ago • 0 comments

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.

DakotaCS avatar Mar 15 '22 20:03 DakotaCS