From e1f7e50164dcfaf67980e488145f90331f7e0a2e Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 29 Jan 2021 02:15:27 +0000 Subject: [PATCH] cleanup an old view --- src/components/AgentTable.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/AgentTable.vue b/src/components/AgentTable.vue index cbcc2e2..bb76cfd 100644 --- a/src/components/AgentTable.vue +++ b/src/components/AgentTable.vue @@ -644,14 +644,14 @@ export default { this.$store.dispatch("loadNotes", pk); }, overdueAlert(category, pk, alert_action) { + const db_field = category === "email" ? "overdue_email_alert" : "overdue_text_alert"; const action = alert_action ? "enabled" : "disabled"; const data = { pk: pk, - alertType: category, - action: action, + [db_field]: alert_action, }; const alertColor = alert_action ? "positive" : "warning"; - axios + this.$axios .post("/agents/overdueaction/", data) .then(r => { this.$q.notify({ @@ -660,7 +660,7 @@ export default { message: `Overdue ${category} alerts ${action} on ${r.data}`, }); }) - .catch(e => this.notifyError(e.response.data.error)); + .catch(() => this.notifyError("Something went wrong")); }, agentClass(status) { if (status === "offline") {