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

Using privat variables for type gives relationships wrong type #76

Open
javve opened this issue Mar 5, 2020 · 1 comment
Open

Using privat variables for type gives relationships wrong type #76

javve opened this issue Mar 5, 2020 · 1 comment

Comments

@javve
Copy link
Contributor

javve commented Mar 5, 2020

If I have a presenter like this

class ImagePresenter extends Presenter {
    type = 'image'
  }

and feed it with data looking like this:

{ 
  id: 1,
  name: 'Bar',
  images: [{ id: 2, url: 'foo'  }]
}

The result will be like this (note objects instead of images):

{
  data: {
    id: 1,
    type: 'event',
    attributes: {
      name: 'Bar'
    },
    relationships: {
      images: {
        data: [{
          id: 2
          type: 'objects'
        }]
      }
    }
  }
}
@jede
Copy link
Contributor

jede commented Feb 2, 2023

Is this still an issue in 3.0?

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

No branches or pull requests

2 participants