Created
August 13, 2024 21:16
-
-
Save visualjeff/e12d6240438113e053d33bfa7a38a070 to your computer and use it in GitHub Desktop.
Buggy code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const productApiResponses = await Promise.all( | |
itemNumbers.map(async (itemNumber: string) => { | |
try { | |
const productAPIResponse = await productService( | |
itemNumber, | |
productConfig, | |
locale | |
); | |
if (!productAPIResponse) return null; | |
return { | |
...productAPIResponse, | |
itemNumber | |
}; | |
} catch (err) { | |
console.log(err); | |
return null; | |
} | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment