DEV Community

Discussion on: E-commerce website - adding/deleting product from database. Part 3

Collapse
mcwolfmm profile image
mcwolfmm • Edited on

I have a few remarks:

When working with Promise, you do not process the rejected state almost anywhere (you do not use the catch function).
Again, when working with Promise, you mix different styles then / catch (your style) and async / await (obviously from the AWS documentation). Choose one of your styles and stick to it (keep in mind that when working with await the rejected state is reduced to an exception so you have to use a try / catch block).

Generate "unique" identifiers with a random number generator. This seems to work but there is no guarantee that you will not duplicate a key. Usually such data is generated by the database that stores the records. However, for you this functionality is limited due to the choice of NoSql database. And this requires you to implement your own counters (which to use as an identifier).

Collapse
kunaal438 profile image
Modern Web Author

I'll say its very good that you are pointing the mistakes so that future comers can improve the issues. πŸ™‚πŸ‘

Collapse
kunaal438 profile image
Modern Web Author

Okay, i got it. I'll fix this and try to improve next timeπŸ™‚