Skip to content

Commit

Permalink
Merge pull request #574 from akto-api-security/feature/test_editor_ap…
Browse files Browse the repository at this point in the history
…i_selection_fix

in TextEditor,  fix update api refresh while saving template
  • Loading branch information
notshivansh authored Sep 18, 2023
2 parents 6b553d1 + 3e23802 commit a229953
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions apps/dashboard/web/src/apps/dashboard/tools/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -436,17 +436,15 @@ export default {
}
this.selectedAnonymousOption = 'Sample data'
},
setMessageJson(result) {
setMessageJson(result, doNotUpdateAPIjson) {
this.messageJson = result.messageJson
this.sampleDataListForTestRun = result.sampleDataListForTestRun
},
setSelectedMethod(testId) {
setSelectedMethod(testId, doNotUpdateAPIjson) {
let testName = this.findTestLabelFromTestValue(testId)
this.changeValue(testName)
this.defaultTest = testId
this.selectedUrl = {}
this.messageJson = {}
this.runTest = false
let pathname = window.location.pathname
Expand All @@ -456,9 +454,10 @@ export default {
if (!(this.mapRequestsToId[testId] && this.mapRequestsToId[testId].length > 0)) {
testId = Object.keys(this.mapRequestsToId)[0]
}
if (this.mapRequestsToId[testId] && this.mapRequestsToId[testId][0]) {
debugger
if (this.mapRequestsToId[testId] && this.mapRequestsToId[testId][0] && !doNotUpdateAPIjson) {
this.selectedUrl = {}
this.messageJson = {}
let obj = {
apiCollectionId: this.mapRequestsToId[testId][0].apiCollectionId,
url: this.mapRequestsToId[testId][0].url,
Expand Down Expand Up @@ -507,7 +506,7 @@ export default {
color: 'green'
});
await this.refreshTestTemplates()
this.setSelectedMethod(resp.finalTestId)
this.setSelectedMethod(resp.finalTestId, true)
})
}
},
Expand Down

0 comments on commit a229953

Please sign in to comment.