Skip to content

Commit 8beb619

Browse files
authored
Fix backfill rerun error (#70)
1 parent 864796d commit 8beb619

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

frontend/src/components/HForm.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,16 @@ export default {
129129
loadFormDefinition () {
130130
this.spinning = true
131131
this.resetForm()
132-
HRequest.get('/api/action/' + this.actionName).then(
133-
(response) => this.formDefinitionHandler(response)
132+
HRequest.get('/api/action/' + this.actionName).then((response) => {
133+
this.formDefinitionHandler(response)
134+
this.handelBackfill(this.$route.query.backfill)
135+
}
134136
)
135-
136-
const queryParams = this.$route.query
137-
if (queryParams.backfill && Number(queryParams.backfill) > 0) {
138-
const notificationTitle = "Rerun ticket " + queryParams.backfill + " error"
139-
HRequest.get('/api/ticket/' + queryParams.backfill).then(
137+
},
138+
handelBackfill (backfillNum) {
139+
if (backfillNum && Number(backfillNum) > 0) {
140+
const notificationTitle = "Rerun ticket " + backfillNum + " error"
141+
HRequest.get('/api/ticket/' + backfillNum).then(
140142
(response) => {
141143
const ticketsLen = response.data.data.tickets.length
142144
if (ticketsLen == 1) {
@@ -147,12 +149,12 @@ export default {
147149
} else {
148150
this.errorAsNotification(
149151
notificationTitle,
150-
"The backfill ticket should be the same action ticket, but ticket " + queryParams.backfill + "'s action was: " + ticket.provider_object
152+
"The backfill ticket should be the same action ticket, but ticket " + backfillNum + "'s action was: " + ticket.provider_object
151153
)
152154
}
153155
} else {
154156
this.errorAsNotification(
155-
"Rerun ticket " + queryParams.backfill + " error",
157+
"Rerun ticket " + backfillNum + " error",
156158
"Expect exactly 1 ticket info but got " + ticketsLen + "item(s)"
157159
)
158160
}

0 commit comments

Comments
 (0)