Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] /council-member-profile request access an invalid object structure #122

Open
nblogist opened this issue Oct 28, 2020 · 0 comments
Open
Labels
bug Something isn't working

Comments

@nblogist
Copy link

Describe the bug
If a council member doesn't have socialInfo.name then the stashId is supposed to be displayed on /council-member-profile/[stashId] page, but here in frontend it tries to access .keyStats.stashId where as the response from backend have a structure like so:

{
    "accountId": "mxVrP5gTRTDEqN1g6Nda8i25xsGXqMRgL7f6S4TSBHiFZRk",
    "backing": 91666705.596,
    "totalBalance": 212676479325586550000,
    "isRunnersUp": false,
    "backersInfo": [
        {
            "stake": 55000050.021,
            "backer": "hvbKv4YVWzqG1DGvLrvTFunh1bcd9THDv84dDRcJSNS6UA9",
            "name": null
        },
        {
            "stake": 55000000,
            "backer": "mQDFSQxf3c5E7cRwHG2CXKkyrtytAhExPz9XALiDbpU1M6n",
            "name": null
        }
    ],
    "additionalInfo": {},
    "socialInfo": {
        "name": null,
        "email": null,
        "legal": null,
        "riot": null,
        "twitter": null,
        "web": null
    },
    "transparencyScores": {
        "name": 0,
        "email": 0,
        "legal": 0,
        "riot": 0,
        "twitter": 0,
        "web": 0,
        "total": 0
    }
}

which causes the application to break on accessing a value on undefined keyStats

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://localhost:[port for frontend]/council-members
  2. Click on any member's view profile (make sure there isn't a socialInfo defined for it)
  3. See error

Expected behavior
Should Display this page:
image

Desktop (please complete the following information):

  • OS: Ubunut 20.04 LTS
  • Browser Brave

Proposed Solution 💡
Change this line to : this.props.memberInfo.accountId;

@nblogist nblogist added the bug Something isn't working label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant