Incremental improvements to this function will come with moving to an admin interface (issue #23) and making team and player links unique within the league (issue #1), but the function will need a number of improvements in addition to these. Namely:
Ensure all routes can be accessed if and only if the necessary conditions for access are satisfied
Each require... function that requires the user be logged in should probably do that first, just to be safe.
These are the main high level improvements I can think of; if I think of any more I'll add them here.
Incremental improvements to this function will come with moving to an admin interface (issue #23) and making team and player links unique within the league (issue #1), but the function will need a number of improvements in addition to these. Namely:
require...
function that requires the user be logged in should probably do that first, just to be safe.These are the main high level improvements I can think of; if I think of any more I'll add them here.