diff --git a/snippets/updating-data/create-record/handler.js b/snippets/updating-data/create-record/handler.js index 1b6430c..e2d83b8 100644 --- a/snippets/updating-data/create-record/handler.js +++ b/snippets/updating-data/create-record/handler.js @@ -4,7 +4,6 @@ import { serializeResources } from '@ember-data/json-api/request'; const MUTATION_OPS = new Set(['createRecord', 'updateRecord']); - const updatesHandler = { request(context, next) { if (!MUTATION_OPS.has(context.request.op)) { diff --git a/snippets/updating-data/save-record/handler.js b/snippets/updating-data/save-record/handler.js index 1a90e29..7aea773 100644 --- a/snippets/updating-data/save-record/handler.js +++ b/snippets/updating-data/save-record/handler.js @@ -1,9 +1,9 @@ // Create handler for serialization of any record import { serializeResources } from '@ember-data/json-api/request'; -const updatesHandler = { - MUTATION_OPS: new Set(['createRecord', 'updateRecord']), +const MUTATION_OPS = new Set(['createRecord', 'updateRecord']); +const updatesHandler = { request(context, next) { if (!MUTATION_OPS.has(context.request.op)) { // Not a mutation, do nothing diff --git a/tests/integration/components/guide-section/subsection-test.js b/tests/integration/components/guide-section/subsection-test.js index 6c29c16..1405893 100644 --- a/tests/integration/components/guide-section/subsection-test.js +++ b/tests/integration/components/guide-section/subsection-test.js @@ -61,7 +61,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community lib!) if not.' + 'Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community library!) if not.' ); const emberClassic = this.element.querySelector( @@ -97,7 +97,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'To create a new record using Ember Data you should use createRecord request and attach "body" to it. In case of JSON:API backend - you can use serializeResources request utility.' + 'To create a new record using Ember Data, you should use a createRecord request and attach "body" to it. Use the serializeResources request utility when working with a JSON:API backend.' ); const emberClassic = this.element.querySelector( @@ -133,7 +133,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'To delete an existing record using Ember Data you should use deleteRecord builder to issue the request.' + 'To delete an existing record using Ember Data, you should use deleteRecord builder to issue the request.' ); const emberClassic = this.element.querySelector( diff --git a/translations/adapters/path-for-type/en-us.yaml b/translations/adapters/path-for-type/en-us.yaml index f7060e0..69f524b 100644 --- a/translations/adapters/path-for-type/en-us.yaml +++ b/translations/adapters/path-for-type/en-us.yaml @@ -2,4 +2,4 @@ title: Use request builders instead of pathForType description: > To modify a URL for a request you can use the ''resourcePath'' option for every request builder. Default configuration for ''JSON:API'', ''REST'', and ''ActiveRecord'' builders will be provided by EmberData.
- We recommend creating your own utility file with request builders that suite your backend's needs. + We recommend creating your own utility file with request builders that suit your backend's needs. diff --git a/translations/deleting-data/delete-record/en-us.yaml b/translations/deleting-data/delete-record/en-us.yaml index 5e0a441..b82a0ef 100644 --- a/translations/deleting-data/delete-record/en-us.yaml +++ b/translations/deleting-data/delete-record/en-us.yaml @@ -1,2 +1,2 @@ title: deleteRecord -description: To delete an existing record using Ember Data you should use deleteRecord builder to issue the request. +description: To delete an existing record using Ember Data, you should use deleteRecord builder to issue the request. diff --git a/translations/fetching-data/find-all/en-us.yaml b/translations/fetching-data/find-all/en-us.yaml index f47481b..637a0ac 100644 --- a/translations/fetching-data/find-all/en-us.yaml +++ b/translations/fetching-data/find-all/en-us.yaml @@ -1,4 +1,4 @@ title: findAll description: | - There is no direct replacement for findAll, you can use query without extra options instead. Here is how to achieve exact findAll behavior: - We discourage using peekAll. When you made a request, you need to guarantee that everything you requested is part of response you get back. + There is no direct replacement for findAll, so you can use query with extra options instead. Here's how to achieve exact findAll behavior: + We discourage using peekAll, but it is currently the best way to guarantee that everything you requested is part of the response you get back. diff --git a/translations/fetching-data/find-record/en-us.yaml b/translations/fetching-data/find-record/en-us.yaml index 1c357ed..9e0e013 100644 --- a/translations/fetching-data/find-record/en-us.yaml +++ b/translations/fetching-data/find-record/en-us.yaml @@ -1,3 +1,3 @@ title: findRecord description: | - Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community lib!) if not. + Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community library!) if not. diff --git a/translations/fetching-data/query/en-us.yaml b/translations/fetching-data/query/en-us.yaml index 98e9817..e738a7a 100644 --- a/translations/fetching-data/query/en-us.yaml +++ b/translations/fetching-data/query/en-us.yaml @@ -1,2 +1,2 @@ title: query -description: The query just moved out from being on Store public interface to builders. +description: The query has moved from the Store public interface to builders. diff --git a/translations/serializers/general/en-us.yaml b/translations/serializers/general/en-us.yaml index 36a7f4b..3979eb7 100644 --- a/translations/serializers/general/en-us.yaml +++ b/translations/serializers/general/en-us.yaml @@ -8,8 +8,8 @@ description: |
Similarly, the methods ''adapterFor'' and ''serializerFor'' will not be deprecated until at least 6.0; however, it should no longer be assumed that an application has an adapter or serializer at all.
- Serializers previously was used to accomplish two main things: serialization and normalization. + Serializers previously were used to accomplish two main things: serialization and normalization.
Normalization is now done in handlers, before returning the response.
- Serialization can be done in handler, but we encourage application developers to do it in request builder. + Serialization can be done in a handler, but we encourage application developers to do it in request builder. diff --git a/translations/updating-data/create-record/en-us.yaml b/translations/updating-data/create-record/en-us.yaml index 1efc5d3..d03ee25 100644 --- a/translations/updating-data/create-record/en-us.yaml +++ b/translations/updating-data/create-record/en-us.yaml @@ -1,2 +1,2 @@ title: createRecord -description: To create a new record using Ember Data you should use createRecord request and attach "body" to it. In case of JSON:API backend - you can use serializeResources request utility. +description: To create a new record using Ember Data, you should use a createRecord request and attach "body" to it. Use the serializeResources request utility when working with a JSON:API backend.