2
2
1
u/TheShuttleCrabster Oct 31 '22
I'm Kinda hating on .then chains nowadays.
Edit: do use a try catch in first one if you prefer it.
0
u/MrPoopypantalons Oct 31 '22
You can also write the first function in a Try..catch block to make it look more like a second option.
-3
u/GaymerWasTaken Oct 31 '22
The second just feels cleaner and even has error handling so if it's written right is a 10/10 for me
4
u/[deleted] Oct 31 '22
Assuming findbyId has its own catch.
1st looks better. You are using async await. Code is clean and single indentation.
In the 2nd I guess you need to wait anyway for save before proceeding. You may have to use another then or await.