@messaia/cdk 21.0.0-rc.12 → 21.0.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2022/messaia-cdk.mjs
CHANGED
|
@@ -14291,8 +14291,19 @@ class GenericService {
|
|
|
14291
14291
|
* @param handleError Handle errors
|
|
14292
14292
|
*/
|
|
14293
14293
|
patch(id, body, path, httpOptions, handleError = true) {
|
|
14294
|
-
|
|
14295
|
-
|
|
14294
|
+
/* Ensure correct content-type for patch */
|
|
14295
|
+
const headers = new HttpHeaders({
|
|
14296
|
+
'Content-Type': 'application/json-patch+json'
|
|
14297
|
+
});
|
|
14298
|
+
/* Merge headers */
|
|
14299
|
+
const options = {
|
|
14300
|
+
...httpOptions,
|
|
14301
|
+
headers: httpOptions?.headers
|
|
14302
|
+
? httpOptions.headers.append('Content-Type', 'application/json-patch+json')
|
|
14303
|
+
: headers
|
|
14304
|
+
};
|
|
14305
|
+
/* Create request */
|
|
14306
|
+
let request = this.http.patch(`${this.endpoint}${path ? path : ''}/${id}`, body, options);
|
|
14296
14307
|
/* Handle error */
|
|
14297
14308
|
if (handleError) {
|
|
14298
14309
|
request = request.pipe(catchError(this.handleError('patch')));
|