8000 fix(adapter): moves loadRelationsFor logic into separate method by stalniy · Pull Request #10 · js-data/js-data-adapter · GitHub
[go: up one dir, main page]

Skip to content

fix(adapter): moves loadRelationsFor logic into separate method #10

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

Merged
merged 2 commits into from
Jul 2, 2017
Merged

fix(adapter): moves loadRelationsFor logic into separate method #10

merged 2 commits into from
Jul 2, 2017

Conversation

stalniy
Copy link
Contributor
@stalniy stalniy commented Jun 12, 2017

Fixes code duplication issue with loadRelations logic. Moving this into a single method will allow to override behavior for specific adaptors. For example, in my REST I want to be able to request all relations in 1 request instead of multiple. In this case, I just send GET /messages?with=creator and server returns back:

{
  "messages": [...],
  "creator": [...]
}

Then I need to map this records. And in order to do this I will override method loadRelationsFor in my custom adapter

  • - npm test succeeds
  • - Code coverage does not decrease (if any source code was changed)
  • - Appropriate JSDoc comments were updated in source code (if applicable) no need for this
  • - Approprate changes to js-data.io docs have been suggested ("Suggest Edits" button) no need for this

@stalniy
Copy link
Contributor Author
stalniy commented Jun 15, 2017

@jmdobry could you please review?

@jmdobry jmdobry merged commit c46a983 into js-data:master Jul 2, 2017
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

Successfully merging this pull request may close these issues.

2 participants
0