rest-client-sdk 7.6.0 → 7.7.0

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/dist/index.cjs CHANGED
@@ -861,15 +861,18 @@
861
861
  /**
862
862
  * delete an entity
863
863
  *
864
- * @param {Record<string, unknown>} the entity to delete
864
+ * @param {Record<string, unknown>} entity the entity to delete
865
865
  * @param {Record<string, unknown>} requestParams parameters that will be send as second parameter to the `fetch` call
866
+ * @param {Record<string, unknown>} queryParam query parameters that will be added to the request
866
867
  */
867
868
  }, {
868
869
  key: "delete",
869
870
  value: function _delete(entity) {
870
871
  var _this = this;
871
872
  var requestParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
872
- var url = this.getEntityURI(entity);
873
+ var queryParam = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
874
+ var url = new URI(this.getEntityURI(entity));
875
+ url.addSearch(queryParam);
873
876
  var identifier = this._getEntityIdentifier(entity);
874
877
  return this.authorizedFetch(url, _objectSpread2({
875
878
  method: 'DELETE'
@@ -1063,7 +1066,11 @@
1063
1066
  var _this6 = this;
1064
1067
  var params = requestParams;
1065
1068
  var baseHeaders = {};
1066
- if (params.method !== 'GET' || params.method !== 'GET' && params.method !== 'DELETE') {
1069
+
1070
+ // a FormData body must let fetch set the Content-Type itself,
1071
+ // with the multipart/form-data boundary
1072
+ var isFormDataBody = FormData !== undefined && params.body instanceof FormData;
1073
+ if ((params.method !== 'GET' || params.method !== 'GET' && params.method !== 'DELETE') && !isFormDataBody) {
1067
1074
  baseHeaders = {
1068
1075
  'Content-Type': 'application/json'
1069
1076
  };