Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

create.js and edit.js routes shouldn't have DB ops in them - factor out #6

Open
leostratus opened this issue Apr 12, 2013 · 2 comments

Comments

@leostratus
Copy link

This is a no-brainer, really. CRUD ops should live in their own happy little module. Things inside these files are very spaghetti; no function should be as long as some of the ones in these files are.

Easy to solve by factoring the operations out, would also DRY things up a whole lot.

Had to ship though, so these were written in a very non-ideal rush.

@leostratus
Copy link
Author

That being said, the server-side validation checks could live in their own module as well. That would clean things up almost entirely.

@leostratus
Copy link
Author

Create.js jas since been refactored a bit, and some operations factored out into their own modules.
Edit.js is a plate of spaghetti and C&P (OMG EMBARRASSING) which hopefully I'll get to cleaning up soon.

There is still not enough separation between routing flow and the DB ops though. More work to be done on both of them there once edit.js is a bit more sane.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant