File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-api-queries" ,
3
- "version" : " 0.0.13 " ,
3
+ "version" : " 0.0.14 " ,
4
4
"description" : " Elegant and simple way to build requests for REST API" ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ class BaseProxy {
103
103
return parameters . length === 0 ? url : `${ url } ?${ parameters . join ( '&' ) } `
104
104
}
105
105
106
- __getQueryString ( parameter : string ) : string [ ] {
106
+ __getQueryString ( parameter : string ) : any | any [ ] {
107
107
const queries : string [ ] = parameter . split ( '&' )
108
108
const obj : any = { }
109
109
queries . forEach ( function ( property : string ) {
@@ -180,7 +180,10 @@ class BaseProxy {
180
180
181
181
setParameter ( parameter : string , value ?: any ) : this {
182
182
if ( ! value ) {
183
- this . parameters = this . __getQueryString ( parameter )
183
+ const params = this . __getQueryString ( parameter )
184
+ Object . entries ( params ) . forEach (
185
+ ( [ key , value ] ) => ( this . parameters [ key ] = value ) ,
186
+ )
184
187
return this
185
188
}
186
189
this . parameters [ parameter ] = value
You can’t perform that action at this time.
0 commit comments