Promisify all mongoose queries using async/await
Nature of issue?
- [X] Existing feature enhancement
Feature enhancement details:
Right now, all of the mongoose queries use callbacks instead of the new ES6 promise syntax. This should be updated as nested callbacks are difficult to read.
I'm on it.
@dhruvdutt still on it?
Yeah. I've already started with it. Will be pushing by this week.
is anyone assigned to this issue?
@dhruvdutt started working on it but i don't know how far they got. feel free to start on this!
it might be helpful to work on this in pieces, like promisify one controller at a time or something.
Ah! I'm sorry, couldn't get back to this. I would be happy to review a PR. Best of luck @migom6 :+1:
Working!
this is a big issue, so i recommend making small PR's!
@catarak As the task is huge, I too would like to contribute to this.
Are we prefer the promise .then chains, or should the code be using async/await? I would prefer the latter for readability
i definitely prefer async / await! i'll update the issue title.
We have to change the error handling mechanics with async/await , I have some links , I will post them here
There's an in-depth conversation about some of the struggles of using async-await with Express: https://github.com/processing/p5.js-web-editor/pull/973
TL;DR It makes sense to include an async middleware like express-async-handler, or update to a different Node framework, like Fastify or Koa.
@raclim Can I work on this issue?
@yugalkaushik feel free to give it a go! I'd echo an earlier comment on breaking this down into smaller PRs!
@raclim hey I would also like to work on htis can I ? submit a PR as well