diff --git a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue index 6c30938c06e1..fb8ffe7ba56d 100644 --- a/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue +++ b/src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue @@ -163,6 +163,7 @@ import PluginMetadataInput from "@/plugin/PluginMetadataInput.vue" import ServiceSelect from "@/service/ServiceSelect.vue" import ProjectSelect from "@/project/ProjectSelect.vue" import TemplateSelect from "@/document/template/TemplateSelect.vue" +import ProjectApi from "@/project/api" export default { setup() { @@ -220,8 +221,12 @@ export default { }, created() { if (this.$route.query.project) { + // required for plugin metadata this.project = { name: this.$route.query.project } - this.incidentProject = this.project + ProjectApi.getAll({ q: this.$route.query.project }).then((response) => { + this.incidentProject = response.data.items[0] + this.project = response.data.items[0] + }) } }, } diff --git a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue index 0182b9d0d27c..48c44f4e41f9 100644 --- a/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue +++ b/src/dispatch/static/dispatch/src/incident/type/IncidentTypeSelect.vue @@ -124,7 +124,7 @@ export default { if (this.project) { filterOptions.filters = { - project: [this.project], + project_id: this.project_id, enabled: ["true"], } } diff --git a/src/dispatch/static/dispatch/src/service/ServiceSelect.vue b/src/dispatch/static/dispatch/src/service/ServiceSelect.vue index dd180aab9a29..820ac94c4efc 100644 --- a/src/dispatch/static/dispatch/src/service/ServiceSelect.vue +++ b/src/dispatch/static/dispatch/src/service/ServiceSelect.vue @@ -113,14 +113,14 @@ export default { } if (this.project) { - filterOptions.filters.project_id = this.project.map((p) => p.id) + filterOptions.filters.project_id = this.project.id } if (this.healthMetrics) { filterOptions.filters.health_metrics = ["true"] } - filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }) + filterOptions = SearchUtils.createParametersFromTableOptions({ ...filterOptions }, "Service") ServiceApi.getAll(filterOptions).then((response) => { this.items = response.data.items