Skip to content

Conversation

@rosesyrett
Copy link
Contributor

created folder to contain logic of handling API calls, to separate this from actual API calls in routes/.

Currently this feels a bit pointless, as I don't have a database to connect to. However in future, if I am needing to interact with a database for example, this could be a great help as database specific functions can go in controllers/ and not clutter anything in routes/.

Additionally, I tried to make it very clear what the dependencies are for each APIRoute instance - unpickleHKl and pickleHkl. In future, these will be removed or replaced and instead a middleware for a db connection will be added.

Copy link
Contributor

@callumforrester callumforrester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few general comments:

  • There's a mix of sync and async code, we should deal with that in a separate PR
  • Persistence can also be more fully separated, again probably best to do that in another PR. Rough, untested example for a single endpoint here: https://github.com/RAYemelyanova/diffcalc_API/pull/4/files
  • What you've called controllers is often used to refer to what you've called routes, so I would name that module something different. Maybe services?

@rosesyrett rosesyrett dismissed callumforrester’s stale review July 14, 2022 11:03

I have made the requested changes and am going to make 2 new PRs to address asaync/sync issues and persistence.

@rosesyrett rosesyrett merged commit fc51929 into master Jul 14, 2022
@rosesyrett rosesyrett deleted the decoupleDataHandlingLogic branch July 14, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants