Skip to content

Commit cffefa9

Browse files
committed
Address comments
1 parent dee28d1 commit cffefa9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

ui/src/utils/request.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ service.interceptors.request.use(config => {
151151
config.cancelToken = source.token
152152

153153
// Handle GET requests (params)
154+
handleGetRequestParams(config)
155+
156+
handlePostRequestParams(config)
157+
158+
return config
159+
}, err)
160+
161+
function handleGetRequestParams (config) {
154162
if (config && config.params) {
155163
config.params.response = 'json'
156164
const project = vueProps.$localStorage.get(CURRENT_PROJECT)
@@ -162,11 +170,12 @@ service.interceptors.request.use(config => {
162170
}
163171
}
164172
if (config.params.ignoreproject !== undefined) {
165-
config.params.ignoreproject = null
173+
delete config.params.ignoreproject
166174
}
167175
}
176+
}
168177

169-
// Handle POST requests (data)
178+
function handlePostRequestParams (config) {
170179
if (config && config.data && config.data instanceof URLSearchParams) {
171180
const project = vueProps.$localStorage.get(CURRENT_PROJECT)
172181
const command = config.data.get('command')
@@ -184,9 +193,7 @@ service.interceptors.request.use(config => {
184193
config.data.delete('ignoreproject')
185194
}
186195
}
187-
188-
return config
189-
}, err)
196+
}
190197

191198
// response interceptor
192199
service.interceptors.response.use((response) => {

0 commit comments

Comments
 (0)