@jetbrains/ring-ui 4.2.10 → 4.2.11

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.
@@ -182,15 +182,29 @@ export default class HTTP {
182
182
 
183
183
  get = (url, params) => (
184
184
  this.request(url, {
185
- method: 'GET',
186
- ...params
185
+ ...params,
186
+ method: 'GET'
187
187
  })
188
188
  );
189
189
 
190
190
  post = (url, params) => (
191
191
  this.request(url, {
192
- method: 'POST',
193
- ...params
192
+ ...params,
193
+ method: 'POST'
194
+ })
195
+ );
196
+
197
+ delete = (url, params) => (
198
+ this.request(url, {
199
+ ...params,
200
+ method: 'DELETE'
201
+ })
202
+ );
203
+
204
+ put = (url, params) => (
205
+ this.request(url, {
206
+ ...params,
207
+ method: 'PUT'
194
208
  })
195
209
  );
196
210
  }
@@ -184,4 +184,18 @@ describe('HTTP', () => {
184
184
 
185
185
  http.request.should.have.been.calledWith('testurl', {method: 'POST', body: {foo: 'bar'}});
186
186
  });
187
+
188
+ it('"delete" method should call request with DELETE type', async () => {
189
+ sandbox.stub(http, 'request');
190
+ await http.delete('testurl', {body: {foo: 'bar'}});
191
+
192
+ http.request.should.have.been.calledWith('testurl', {method: 'DELETE', body: {foo: 'bar'}});
193
+ });
194
+
195
+ it('"put" method should call request with PUT type', async () => {
196
+ sandbox.stub(http, 'request');
197
+ await http.put('testurl', {body: {foo: 'bar'}});
198
+
199
+ http.request.should.have.been.calledWith('testurl', {method: 'PUT', body: {foo: 'bar'}});
200
+ });
187
201
  });
package/dist/http/http.js CHANGED
@@ -91,14 +91,20 @@ class HTTP {
91
91
 
92
92
  _defineProperty(this, "getMetaForResponse", response => this._requestsMeta.get(response));
93
93
 
94
- _defineProperty(this, "get", (url, params) => this.request(url, {
95
- method: 'GET',
96
- ...params
94
+ _defineProperty(this, "get", (url, params) => this.request(url, { ...params,
95
+ method: 'GET'
97
96
  }));
98
97
 
99
- _defineProperty(this, "post", (url, params) => this.request(url, {
100
- method: 'POST',
101
- ...params
98
+ _defineProperty(this, "post", (url, params) => this.request(url, { ...params,
99
+ method: 'POST'
100
+ }));
101
+
102
+ _defineProperty(this, "delete", (url, params) => this.request(url, { ...params,
103
+ method: 'DELETE'
104
+ }));
105
+
106
+ _defineProperty(this, "put", (url, params) => this.request(url, { ...params,
107
+ method: 'PUT'
102
108
  }));
103
109
 
104
110
  if (_auth) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "4.2.10",
3
+ "version": "4.2.11",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -221,5 +221,5 @@
221
221
  "node": ">=7.4",
222
222
  "npm": ">=6.0.0"
223
223
  },
224
- "gitHead": "3a00246c7a23d279851faf012e999f7ed92157ee"
224
+ "gitHead": "a2d57bbffa8a2fde61fbd4f50be5ef771ace066d"
225
225
  }