MCPcopy Create free account
hub / github.com/apache/cloudstack / handlePostRequestParams

Function handlePostRequestParams

ui/src/utils/request.js:177–195  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

175}
176
177function handlePostRequestParams (config) {
178 if (config && config.data && config.data instanceof URLSearchParams) {
179 const project = vueProps.$localStorage.get(CURRENT_PROJECT)
180 const command = config.data.get('command')
181 const hasProjectId = config.data.has('projectid')
182 const ignoreProject = config.data.has('ignoreproject')
183
184 if (!hasProjectId && !ignoreProject && project && project.id) {
185 if (command === 'listTags') {
186 config.data.append('projectid', '-1')
187 } else if (command !== 'assignVirtualMachine') {
188 config.data.append('projectid', project.id)
189 }
190 }
191 if (config.data.has('ignoreproject')) {
192 config.data.delete('ignoreproject')
193 }
194 }
195}
196
197// response interceptor
198service.interceptors.response.use((response) => {

Callers 1

request.jsFile · 0.85

Calls 4

getMethod · 0.65
deleteMethod · 0.65
hasMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected