Skip to content

Commit 76bdf91

Browse files
committed
fix: :penicil2: rename the property
1 parent 6ac5624 commit 76bdf91

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ export default {
4747
// simple usage
4848
'vue-axios-http/nuxt',
4949
// With options
50-
['vue-axios-http/nuxt', { errorProperty: 'errors', removeParams: true }],
50+
['vue-axios-http/nuxt', { errorProperty: 'errors', resetParameter: true }],
5151
'@nuxtjs/axios',
5252
],
53-
axiosHttp: { errorProperty: 'errors', removeParams: true },
53+
axiosHttp: { errorProperty: 'errors', resetParameter: true },
5454
}
5555
```
5656

src/__tests__/base-service.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ describe('BaseService -> Remove parameters', () => {
349349
validator = Validator
350350
const axios = Axios.create({ baseURL: 'https://mock-api.test' })
351351
BaseService.$http = axios
352-
BaseService.$removeParams = true
352+
BaseService.$resetParameter = true
353353
BaseService.$errorProperty = 'message'
354354

355355
service = new PostService()

src/core/BaseService.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default class BaseService {
1616
public errors = Validator
1717
static $http: AxiosInstance
1818
static $errorProperty = 'errors'
19-
static $removeParams? = false
19+
static $resetParameter? = false
2020
static $parsedQs: IParseOptions = {
2121
comma: true,
2222
allowDots: true,
@@ -33,8 +33,8 @@ export default class BaseService {
3333
return BaseService.$errorProperty
3434
}
3535

36-
get $removeParams() {
37-
return BaseService.$removeParams
36+
get $resetParameter() {
37+
return BaseService.$resetParameter
3838
}
3939

4040
get $parsedQs() {
@@ -107,7 +107,7 @@ export default class BaseService {
107107
}
108108
reject(error)
109109
})
110-
if (this.$removeParams) this.removeParameters()
110+
if (this.$resetParameter) this.removeParameters()
111111
})
112112
}
113113

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import Validator from './core/Validator'
99
import './vue'
1010

1111
interface ModuleOptions {
12-
removeParams?: boolean
12+
resetParameter?: boolean
1313
parsedQs: IParseOptions
1414
errorProperty?: string | 'errors' | 'message'
1515
}
1616
const optionDefault: ModuleOptions = {
17-
removeParams: false,
17+
resetParameter: false,
1818
parsedQs: {
1919
comma: true,
2020
allowDots: true,
@@ -29,10 +29,10 @@ class AxiosHttp {
2929
if (this.installed) return
3030

3131
this.installed = true
32-
const { errorProperty, parsedQs, removeParams } = merge(optionDefault, options)
32+
const { errorProperty, parsedQs, resetParameter } = merge(optionDefault, options)
3333

3434
BaseService.$parsedQs = parsedQs
35-
BaseService.$removeParams = removeParams
35+
BaseService.$resetParameter = resetParameter
3636
BaseService.$errorProperty = errorProperty || 'errors'
3737
Vue.mixin({
3838
beforeCreate() {

0 commit comments

Comments
 (0)