All new code requires tests to ensure against regressions.
However, if your PR contains zero code changes, feel free to select the checkmark below to indicate so.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
This PR refactors ./src/handlers/package_handler.js. The file had become over 1000 lines long, and many of the changes being needed recently only effected a small subset of that code, increasing the possibility of conflicts and increasing complexity to deal with the file, and difficulty finding the right parts of the code to make changes on.
This PR provides no real change to how the code runs, all it does is simply expand things a bit, to move the contents of package_handler.js into several new files accomplishing the same tasks, having moved the contents into:
delete_package_handler.js: Contains all endpoints of package_handler.js that are of the HTTP DELETE Method
get_package_handler.js: Contains all endpoints of package_handler.js that are of the HTTP GET Method
post_package_handler.js: Contains all endpoints of package_handler.js that are of the HTTP POST Method
The idea here is simply to make each file easier to keep in mind, and find what's needed to make additional changes or improvements.
We still use package_handler.js to help export all of these handlers under the correct function names so that they can be consumed with zero change by main.js and by tests.
Requirements
Filling out the template is required.
All new code requires tests to ensure against regressions.
[X] Have you ran tests against this code?
[ ] This PR contains zero code changes.
Description of the Change
This PR refactors
./src/handlers/package_handler.js
. The file had become over 1000 lines long, and many of the changes being needed recently only effected a small subset of that code, increasing the possibility of conflicts and increasing complexity to deal with the file, and difficulty finding the right parts of the code to make changes on.This PR provides no real change to how the code runs, all it does is simply expand things a bit, to move the contents of
package_handler.js
into several new files accomplishing the same tasks, having moved the contents into:delete_package_handler.js
: Contains all endpoints ofpackage_handler.js
that are of the HTTP DELETE Methodget_package_handler.js
: Contains all endpoints ofpackage_handler.js
that are of the HTTP GET Methodpost_package_handler.js
: Contains all endpoints ofpackage_handler.js
that are of the HTTP POST MethodThe idea here is simply to make each file easier to keep in mind, and find what's needed to make additional changes or improvements.
We still use
package_handler.js
to help export all of these handlers under the correct function names so that they can be consumed with zero change bymain.js
and by tests.