My point is, we should not split logic inside a method using if/else based on the passed Boolean parameter. As a best practice we should not write business logic inside controllers. Therefore you should not handle logic in the controller. What I suggest you is take the argument in the controller and send it to the business/service layer. In that layer you can split the logic to two methods. That’s what we do in Facade pattern. No need to create two endpoints in controller.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store