RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
544 stars 129 forks source link

TypeError: Cannot read property 'Variants' of undefined #78

Closed ijo-amali closed 3 years ago

ijo-amali commented 6 years ago

Using Runkit, I'm trying to return a JSON of a menu of my local Domino's. It's returning this instead: {} So I checked the endpoint logs and there's this error:

TypeError: Cannot read property 'Variants' of undefined
 in pizzapi/src/Store.js — line 62

var variantKeys = Object.keys(result.result.Variants)

You can see the full code here: https://runkit.com/levistep32/5b8a05f1ed7d5b0012a8ecec

RIAEvangelist commented 3 years ago

result.result is not defined in the scope you are trying to use it in. Maybe just try result.