You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the code looks very untidy, you should better add different layers to differentiate concerns.
What I personally prefer and recommend is to use a flow like this
Routes -> Controllers ->Services -> Repository
Routes - Everything related to routing goes here
Controllers - It only handles where does the request goes in order to get handled and what response does it get.