File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export default (apiUrl, httpClient = fetchJsonWithToken) => {
55
55
// specify reverse orderings by prefixing the field name with '-'
56
56
const order = params . sort . order == 'DESC' ? '-' : '' ;
57
57
const field = params . sort . field || 'id' ;
58
+ const queryParams = params . queryParams || '' ;
58
59
const query = {
59
60
...flattenObject ( params . filter ) ,
60
61
ordering : order + field ,
@@ -64,6 +65,12 @@ export default (apiUrl, httpClient = fetchJsonWithToken) => {
64
65
offset : ( page - 1 ) * perPage
65
66
} ;
66
67
url = `${ apiUrl } /${ resource } /?${ stringify ( query ) } ` ;
68
+
69
+ // If there's extra query parameters given, add them to the url
70
+ if ( queryParams ) {
71
+ url += `&${ stringify ( queryParams ) } ` ;
72
+ }
73
+
67
74
options . method = 'GET' ;
68
75
break ;
69
76
}
@@ -130,7 +137,7 @@ export default (apiUrl, httpClient = fetchJsonWithToken) => {
130
137
const convertHTTPErrorToREST = ( httpError ) => {
131
138
const { status, body, name } = httpError ;
132
139
133
- if ( typeof ( body ) === 'object' && body . detail ) {
140
+ if ( typeof ( body ) === 'object' && body . detail ) {
134
141
httpError . message = body . detail ;
135
142
}
136
143
return Promise . reject ( httpError ) ;
You can’t perform that action at this time.
0 commit comments