Honor Locale for Create/Update/Delete

Created on 25 July 2023, over 1 year ago
Updated 10 March 2024, 9 months ago

Problem/Motivation

When calling createResource, updateResource, or deleteResource the locale should be honored, it is currently ignored which means the default is used.

Steps to reproduce

* Create an instance of JsonApiClient with a defaultLocale of `es`
* Attempt to update a Spanish version of a node with updateResource.
* Note that the english version of the node will be updated instead.

Proposed resolution

* createResource, updateResource, and deleteResource should make use of the defaultLocale if provided.
* createResource, updateResource, and deleteResource should be able to specify a different locale during individual method calls - similar to providing a locale in the GetOptions object when calling getResource or getCollection.

Remaining tasks

* Implement changes.
* Documentation.
* Test coverage.

API changes

* createResource, updateResource, and deleteResource will accept an options object that can include a 'locale' value - this probably means we should move locale into the RequestBaseOptions interface.

🐛 Bug report
Status

Fixed

Component

Code

Created by

🇺🇸United States brianperry

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024