Skip to content

Commit

Permalink
fix: case type query params get ignored on Report Case form (#5742)
Browse files Browse the repository at this point in the history
* fix: case type query params get ignored

This pattern matches the way Incident ReportSubmissionCard is set up and fixes the issue where this.project isn't set in time for the evaluation

* Removed unused variables
  • Loading branch information
aaronherman authored Jan 29, 2025
1 parent 2431406 commit 6ef36c9
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions src/dispatch/static/dispatch/src/case/ReportSubmissionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ import ProjectSelect from "@/project/ProjectSelect.vue"
import DocumentApi from "@/document/api"
import ProjectApi from "@/project/api"
import AuthApi from "@/auth/api"
import SearchUtils from "@/search/utils"
import CaseTypeApi from "@/case/type/api"
export default {
setup() {
Expand Down Expand Up @@ -260,32 +258,7 @@ export default {
}
if (this.$route.query.case_type) {
let filterOptions = {
q: "",
sortBy: ["name"],
descending: [false],
itemsPerPage: this.numItems,
}
if (this.project) {
filterOptions = {
filters: {
project: [this.project],
name: [this.$route.query.case_type],
enabled: ["true"],
},
...filterOptions,
}
}
filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions })
CaseTypeApi.getAll(filterOptions).then((response) => {
if (response.data.items.length > 0) {
this.case_type = response.data.items[0]
} else {
this.case_type = this.$route.query.case_type
}
})
this.case_type = { name: this.$route.query.case_type }
}
if (this.$route.query.case_priority) {
Expand Down

0 comments on commit 6ef36c9

Please sign in to comment.