Skip to content

Commit 367d853

Browse files
committed
Merge branch 'main' of github.com-chantouchsek:chantouchsek/vue-axios-http into feat/remove-transformer-files
2 parents c278084 + b1f2ba2 commit 367d853

File tree

5 files changed

+27
-15
lines changed

5 files changed

+27
-15
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [1.3.0](https://github.com/chantouchsek/vue-axios-http/compare/v1.2.5...v1.3.0) (2022-04-09)
6+
7+
8+
### Features
9+
10+
* :tada: added new method putWithoutId to base service ([8a9e0c2](https://github.com/chantouchsek/vue-axios-http/commit/8a9e0c29aed4e2c9e69aa895b21085a7e0adbc04))
11+
512
### [1.2.5](https://github.com/chantouchsek/vue-axios-http/compare/v1.2.4...v1.2.5) (2022-04-09)
613

714

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-axios-http",
3-
"version": "1.2.5",
3+
"version": "1.3.0",
44
"description": "Elegant and simple way to build requests for REST API",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/__tests__/base-proxy.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,13 @@ describe('BaseProxy', () => {
312312
expect(data).toEqual(item)
313313
})
314314

315+
it('it should be able to put item without id parameter', async () => {
316+
const item = { first_name: 'Chantouch', last_name: 'Sek', id: 1 }
317+
mockAdapter.onPut('posts').reply(200, { data: item })
318+
const { data } = await proxy.putWithoutId(item)
319+
expect(data).toEqual(item)
320+
})
321+
315322
it('it should be able to patch item', async () => {
316323
const item = { first_name: 'Chantouch', last_name: 'Sek', id: 1 }
317324
mockAdapter.onPatch('posts/1').reply(200, { data: item })

src/core/BaseProxy.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ class BaseProxy {
121121
return this.submit<T>('put', `/${id}`, payload)
122122
}
123123

124+
/**
125+
* Update record without ID parameter by using PUT method
126+
* @param {Object|string} payload
127+
*/
128+
putWithoutId<T>(payload: any) {
129+
return this.submit<T>('put', '', payload)
130+
}
131+
124132
/**
125133
* Alternative of put method
126134
* @param {string|number} id

yarn.lock

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3853,20 +3853,10 @@ caniuse-api@^3.0.0:
38533853
lodash.memoize "^4.1.2"
38543854
lodash.uniq "^4.5.0"
38553855

3856-
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001261:
3857-
version "1.0.30001263"
3858-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001263.tgz#7ce7a6fb482a137585cbc908aaf38e90c53a16a4"
3859-
integrity sha512-doiV5dft6yzWO1WwU19kt8Qz8R0/8DgEziz6/9n2FxUasteZNwNNYSmJO3GLBH8lCVE73AB1RPDPAeYbcO5Cvw==
3860-
3861-
caniuse-lite@^1.0.30001259:
3862-
version "1.0.30001261"
3863-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001261.tgz#96d89813c076ea061209a4e040d8dcf0c66a1d01"
3864-
integrity sha512-vM8D9Uvp7bHIN0fZ2KQ4wnmYFpJo/Etb4Vwsuc+ka0tfGDHvOPrFm6S/7CCNLSOkAUjenT2HnUPESdOIL91FaA==
3865-
3866-
caniuse-lite@^1.0.30001275, caniuse-lite@^1.0.30001280:
3867-
version "1.0.30001286"
3868-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001286.tgz#3e9debad420419618cfdf52dc9b6572b28a8fff6"
3869-
integrity sha512-zaEMRH6xg8ESMi2eQ3R4eZ5qw/hJiVsO/HlLwniIwErij0JDr9P+8V4dtx1l+kLq6j3yy8l8W4fst1lBnat5wQ==
3856+
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001259, caniuse-lite@^1.0.30001261, caniuse-lite@^1.0.30001275, caniuse-lite@^1.0.30001280:
3857+
version "1.0.30001327"
3858+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001327.tgz"
3859+
integrity sha512-1/Cg4jlD9qjZzhbzkzEaAC2JHsP0WrOc8Rd/3a3LuajGzGWR/hD7TVyvq99VqmTy99eVh8Zkmdq213OgvgXx7w==
38703860

38713861
chalk@^1.1.3:
38723862
version "1.1.3"

0 commit comments

Comments
 (0)