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

feature: Unify how Account/Org request and response objects are treated. #150

Closed
elboletaire opened this issue Apr 19, 2023 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@elboletaire
Copy link
Member

Describe the feature

Right now, when we create an account, we have a Account class with all the required fields unified in one level, meaning we create accounts this way:

new Account({
  name: 'John Doe',
  description: 'A description about this account',
  avatar: 'https://whatever-avatar.png'
})

But, when getting an account info, the response object looks like...

{
  address: '0x000...',
  balance: 0,
  metadata: {
    media: {
      avatar: 'https://whatever-avatar.png',
    },
  },
}

Meaning we need to use account.metadata.media.avatar to access something that, using Account class is just account.avatar.

Motivation

This does not happen in processes :)

Proposal

Return Account instance from account info responses, which has the metadata fields integrated in a single level, rather than the current IAccount with metadata fields split into different levels.

Components affected

I think only Organization, but maybe could be a good moment to check Process and ensure there's unified too.

@elboletaire elboletaire added the enhancement New feature or request label Apr 19, 2023
@marcvelmer
Copy link
Collaborator

Fixed in #154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants