diff --git a/src/dispatch/static/dispatch/src/case/ReportSubmissionCard.vue b/src/dispatch/static/dispatch/src/case/ReportSubmissionCard.vue index 4f84b7430bc5..8c5eeabc769d 100644 --- a/src/dispatch/static/dispatch/src/case/ReportSubmissionCard.vue +++ b/src/dispatch/static/dispatch/src/case/ReportSubmissionCard.vue @@ -105,6 +105,8 @@ import CasePrioritySelect from "@/case/priority/CasePrioritySelect.vue" import ProjectSelect from "@/project/ProjectSelect.vue" import DocumentApi from "@/document/api" import TagFilterAutoComplete from "@/tag/TagFilterAutoComplete.vue" +import SearchUtils from "@/search/utils" +import CaseTypeApi from "@/case/type/api" export default { setup() { @@ -224,8 +226,34 @@ export default { } if (this.$route.query.case_type) { - this.case_type = { name: this.$route.query.case_type } + this.case_type = 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 + } + }) if (this.$route.query.case_priority) { this.case_priority = { name: this.$route.query.case_priority }