Skip to content

Commit

Permalink
Update safety check for edges
Browse files Browse the repository at this point in the history
  • Loading branch information
akong-sf committed Sep 21, 2023
1 parent ee98174 commit 6729249
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class ScanBarcodeLookup extends LightningElement {
console.log("errors", errors);
if (data) {
const { edges } = data.uiapi.query.Product2;
const product = edges && edges[0];
const product = edges?.shift();
this.productId = product && product.node.Id;
} else {
this.productId = "";
Expand Down

0 comments on commit 6729249

Please sign in to comment.