Skip to content

Commit

Permalink
Merge pull request #6536 from tedraykov/bugfix/order-items-await
Browse files Browse the repository at this point in the history
fix(orders): await order items before additional transformation
  • Loading branch information
brent-hoover authored Sep 27, 2022
2 parents 490a5c1 + 40d172d commit 57ee08a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-spiders-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@reactioncommerce/api-plugin-orders": patch
---

Fix(orders): await order items before passing them to additional transformation function xformOrderItems
2 changes: 1 addition & 1 deletion packages/api-plugin-orders/src/xforms/xformOrderItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import imageURLs from "../util/imageURLs.js";
* @returns {Object[]} Same array with GraphQL-only props added
*/
export default async function xformOrderItems(context, items) {
const xformedItems = Promise.all(items.map(async (item) => ({
const xformedItems = await Promise.all(items.map(async (item) => ({
...item,
imageURLs: await imageURLs(context, item),
productConfiguration: {
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57ee08a

Please sign in to comment.