From 2c657891b5347bf04e5ebce30c6d5b7d986e559e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Mon, 25 May 2020 06:31:06 +0000 Subject: [PATCH] fix mapstate error --- src/components/modals/tasks/AddAutomatedTask.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/modals/tasks/AddAutomatedTask.vue b/src/components/modals/tasks/AddAutomatedTask.vue index 56da068..9b5e0fb 100644 --- a/src/components/modals/tasks/AddAutomatedTask.vue +++ b/src/components/modals/tasks/AddAutomatedTask.vue @@ -156,7 +156,7 @@ export default { timeout: this.timeout }; - console.log(data) + console.log(data); axios .post("tasks/automatedtasks/", data) .then(r => { @@ -180,9 +180,13 @@ export default { }, computed: { ...mapGetters(["selectedAgentPk", "scripts"]), - ...mapState({ - checks: state => this.policypk ? state.automation.checks : state.agentChecks - }), + /* ...mapState({ + checks: state => (this.policypk ? state.automation.checks : state.agentChecks) + }), */ + // I have no idea why this works and the above doesn't + checks() { + return this.policypk ? this.$store.state.automation.checks : this.$store.state.agentChecks; + }, allChecks() { return [ ...this.checks.diskchecks,