Hello! I'm looking for some feedback wrt to how I should refactor my code.
https://gist.github.com/jethrokuan/4f7553644ec90eb1fbd78795cf1b8700
I notice that my code is much like a decision tree: 1. Contains id? -> Some DB Operation -- Success? --> some response
I end up writing a lot of this db handling, and I'm sure there's a way i can reduce the amount of code here, or write in a higher level of abstraction