-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Handle 'data' wrapped responses for Create and Update #109
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment has been minimized.
This comment has been minimized.
Thanks for PR. Could you please include tests? |
# Conflicts: # src/Model.js
JoaoPedroAS51
added a commit
to JoaoPedroAS51/vue-api-query
that referenced
this pull request
Oct 27, 2020
* docs: add nuxt docs * docs: add introduction, installation, configuration, usage and nuxt example * docs: add api docs * docs: update configuration and usage * ci: add nodejs ci * ci: fix setup node version * chore(eslint): add .eslintignore * chore(scripts): add "lint" script * chore(scripts): add "test-watch" script * ci(docs): update deploy action * ci: fix docs and publish * ci: fix docs working directory * docs: fix url * docs: fix base url * ci: fix docs action * docs: fix pages position * chore(script): add `--coverage` flag to `test` script * ci(publish): add step to upload coverage to codecov * chore(scripts): remove "prepare" script * fix(model): add null check in `isValidId` (robsontenorio#115) When an entity is being saved, nulls are considered as existing entities, so it tries to update and not insert. * feat(model): handle 'data' wrapped responses for create and update (robsontenorio#109) Laravel allows data wrapping for all responses, so create and update requests should support this if it is done. * feat(model): add support to nested keys for relations (robsontenorio#127) * feat(utils): add utilities `getProp` and `setProp` * feat(model): add support to nested keys for relations * test(model): test support of nested keys for relations * test(utils): test utilities * chore: update readme * chore: bump node-fetch from 2.6.0 to 2.6.1 (robsontenorio#124) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](node-fetch/node-fetch@v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: update configuration and api options * docs: update api docs * docs(model options): update docs * docs(query builder methods): update docs * docs(model options): add `primaryKey` default value * docs(model options): fix typo * docs(example): rename file of nuxt example * docs: remove usage section * docs: add building query section * docs: fix typo * docs: add "including relationships" * docs: add helpers * docs(operations): fix typo * docs(api): update query builder methods * docs: fix response of section "including relationships" * docs: add "appending attributes" * docs: add "selecting fields" and update other docs * docs: add "paginating" and add missing colons. * docs: add api reference to "selecting fields" section * docs: update "paginating" section * docs: add "applying parameters" * docs: add "calling a custom resource" * docs: add api reference of `params` and `custom` * docs: add "composing without request" * docs: remove unnecessary responses * docs: update "calling a custom resource" * docs: fix crud order * docs: fix create request * docs: update example of delete operation * docs: add "mixing everything up" * docs: fix append example * docs: add "performing operations" * docs: update `select` and `custom` * docs: update model options * docs: update configuration * docs: add vue example Co-authored-by: Guilherme Zanini <[email protected]> Co-authored-by: Francis Adu-Gyamfi <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
JoaoPedroAS51
added a commit
to JoaoPedroAS51/vue-api-query
that referenced
this pull request
Oct 27, 2020
* docs: add nuxt docs * docs: add introduction, installation, configuration, usage and nuxt example * docs: add api docs * docs: update configuration and usage * ci: add nodejs ci * ci: fix setup node version * chore(eslint): add .eslintignore * chore(scripts): add "lint" script * chore(scripts): add "test-watch" script * ci(docs): update deploy action * ci: fix docs and publish * ci: fix docs working directory * docs: fix url * docs: fix base url * ci: fix docs action * docs: fix pages position * chore(script): add `--coverage` flag to `test` script * ci(publish): add step to upload coverage to codecov * chore(scripts): remove "prepare" script * fix(model): add null check in `isValidId` (robsontenorio#115) When an entity is being saved, nulls are considered as existing entities, so it tries to update and not insert. * feat(model): handle 'data' wrapped responses for create and update (robsontenorio#109) Laravel allows data wrapping for all responses, so create and update requests should support this if it is done. * feat(model): add support to nested keys for relations (robsontenorio#127) * feat(utils): add utilities `getProp` and `setProp` * feat(model): add support to nested keys for relations * test(model): test support of nested keys for relations * test(utils): test utilities * chore: update readme * chore: bump node-fetch from 2.6.0 to 2.6.1 (robsontenorio#124) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](node-fetch/node-fetch@v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: update configuration and api options * docs: update api docs * docs(model options): update docs * docs(query builder methods): update docs * docs(model options): add `primaryKey` default value * docs(model options): fix typo * docs(example): rename file of nuxt example * docs: remove usage section * docs: add building query section * chore: update package.json * chore: update README.md * docs: fix typo * docs: add "including relationships" * docs: add helpers * docs(operations): fix typo * docs(api): update query builder methods * docs: fix response of section "including relationships" * docs: add "appending attributes" * docs: add "selecting fields" and update other docs * fix(utils): accept array of strings in param `propName` of `setProp` * test(utils): add tests for `setProp` * fix(utils): fix `getProp` * fix(utils): accept array of strings in param `propName` of `getProp` * test(utils): add tests for `getProp` * refactor(utils): update jsdocs of `getProp` and `setProp` * refactor(test): remove semicolon * docs: add "paginating" and add missing colons. * docs: add api reference to "selecting fields" section * docs: update "paginating" section * docs: add "applying parameters" * docs: add "calling a custom resource" * docs: add api reference of `params` and `custom` * docs: add "composing without request" * docs: remove unnecessary responses * docs: update "calling a custom resource" * docs: fix crud order * docs: fix create request * docs: update example of delete operation * docs: add "mixing everything up" * docs: fix append example * docs: add "performing operations" * docs: update `select` and `custom` * docs: update model options * docs: update configuration * docs: add vue example * docs: update "needless parent request"
JoaoPedroAS51
added a commit
to JoaoPedroAS51/vue-api-query
that referenced
this pull request
Oct 27, 2020
* docs: add nuxt docs * docs: add introduction, installation, configuration, usage and nuxt example * docs: add api docs * docs: update configuration and usage * ci: add nodejs ci * ci: fix setup node version * chore(eslint): add .eslintignore * chore(scripts): add "lint" script * chore(scripts): add "test-watch" script * ci(docs): update deploy action * ci: fix docs and publish * ci: fix docs working directory * docs: fix url * docs: fix base url * ci: fix docs action * docs: fix pages position * chore(script): add `--coverage` flag to `test` script * ci(publish): add step to upload coverage to codecov * chore(scripts): remove "prepare" script * fix(model): add null check in `isValidId` (robsontenorio#115) When an entity is being saved, nulls are considered as existing entities, so it tries to update and not insert. * feat(model): handle 'data' wrapped responses for create and update (robsontenorio#109) Laravel allows data wrapping for all responses, so create and update requests should support this if it is done. * feat(model): add support to nested keys for relations (robsontenorio#127) * feat(utils): add utilities `getProp` and `setProp` * feat(model): add support to nested keys for relations * test(model): test support of nested keys for relations * test(utils): test utilities * chore: update readme * chore: bump node-fetch from 2.6.0 to 2.6.1 (robsontenorio#124) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](node-fetch/node-fetch@v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: update configuration and api options * docs: update api docs * docs(model options): update docs * docs(query builder methods): update docs * docs(model options): add `primaryKey` default value * docs(model options): fix typo * docs(example): rename file of nuxt example * docs: remove usage section * docs: add building query section * chore: update package.json * chore: update README.md * docs: fix typo * docs: add "including relationships" * docs: add helpers * docs(operations): fix typo * docs(api): update query builder methods * docs: fix response of section "including relationships" * docs: add "appending attributes" * docs: add "selecting fields" and update other docs * fix(utils): accept array of strings in param `propName` of `setProp` * test(utils): add tests for `setProp` * fix(utils): fix `getProp` * fix(utils): accept array of strings in param `propName` of `getProp` * test(utils): add tests for `getProp` * refactor(utils): update jsdocs of `getProp` and `setProp` * refactor(test): remove semicolon * docs: add "paginating" and add missing colons. * docs: add api reference to "selecting fields" section * docs: update "paginating" section * docs: add "applying parameters" * docs: add "calling a custom resource" * docs: add api reference of `params` and `custom` * docs: add "composing without request" * docs: remove unnecessary responses * docs: update "calling a custom resource" * docs: fix crud order * docs: fix create request * docs: update example of delete operation * docs: add "mixing everything up" * docs: fix append example * docs: add "performing operations" * docs: update `select` and `custom` * docs: update model options * docs: update configuration * docs: add vue example * docs: update "needless parent request" * docs: remove helpers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Laravel allows data wrapping for all responses, so create and update requests should support this if it is done.