c.JSON I believe pipes out the passed data as a stringify value on whatever network socket the gin context has but doesnt close that connection so when we get an error we end up getting something roughly like error: xyz... success xyz...
we want to close that connection and return early before we get to the success portion of this method
We shouldnt really be making DB calls here generally best practices would be to mak some function in our database folder that for example is called createProduct
that we would just call with our System
, and Barcode
value. Then we would also want to have that database::createProduct
call done within our services
folder (to keep a separation of our network layer and our business logic) but that ones not as big of a deal because this is just a test function that doesnt really have a defined goal in mind