Skip to content

Commit

Permalink
Merge pull request jumpserver#3368 from jumpserver/[email protected]@perf_cloud…
Browse files Browse the repository at this point in the history
…_sync_None_err

fix: 策略删除动作和规则时提示404
  • Loading branch information
ibuler authored Aug 29, 2023
2 parents 21c58e2 + 4cd126b commit e3c4c40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/views/assets/Cloud/Strategy/components/ActionInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ export default {
handleDelete(index) {
return () => {
const item = this.tableConfig.totalData.splice(index, 1)
this.$axios.delete(`/api/v1/xpack/cloud/strategy-actions/${item[0]?.id}/`)
if (item[0]?.id) {
this.$axios.delete(`/api/v1/xpack/cloud/strategy-actions/${item[0].id}/`)
}
this.$message.success(this.$tc('common.deleteSuccessMsg'))
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/views/assets/Cloud/Strategy/components/RuleInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ export default {
handleDelete(index) {
return () => {
const item = this.tableConfig.totalData.splice(index, 1)
this.$axios.delete(`/api/v1/xpack/cloud/strategy-rules/${item[0]?.id}/`)
if (item[0]?.id) {
this.$axios.delete(`/api/v1/xpack/cloud/strategy-rules/${item[0].id}/`)
}
this.$message.success(this.$tc('common.deleteSuccessMsg'))
}
}
Expand Down

0 comments on commit e3c4c40

Please sign in to comment.