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

Nested primaryKey problem #225

Closed
mathieucollet opened this issue Nov 14, 2021 · 1 comment
Closed

Nested primaryKey problem #225

mathieucollet opened this issue Nov 14, 2021 · 1 comment

Comments

@mathieucollet
Copy link

Hey everyone,
I'm meeting a problem setting the primary key of my user model.
The response I receive from backend is formated as { data: {...}, meta: {...} }, so the id is at data.id.

I tried to make something like:

// models/User.js

primaryKey() {
  return 'data.id'
}

But it can't manage to find the id, any suggestion ?

@mathieucollet
Copy link
Author

Sorry for my mistake. I didn't understand that I had to use $find to get directly to the data.

So I close this issue.

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

1 participant