From 75c74a773515477363d8065085faec9b1c15b0f8 Mon Sep 17 00:00:00 2001 From: Sahiba Mittal Date: Thu, 26 Sep 2024 14:33:48 +0100 Subject: [PATCH] Add ability to test notification publishers Co-Authored-By: Ross Murphy <77832827+2000rosser@users.noreply.github.com> --- .../administration/notifications/Alerts.vue | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/views/administration/notifications/Alerts.vue b/src/views/administration/notifications/Alerts.vue index ac8c9407..a850b404 100644 --- a/src/views/administration/notifications/Alerts.vue +++ b/src/views/administration/notifications/Alerts.vue @@ -221,6 +221,7 @@ export default {
+ {{ $t('admin.perform_test') }} @@ -412,6 +413,24 @@ export default { this.$toastr.w(this.$t('condition.unsuccessful_action')); }); }, + testNotification: function () { + let url = `${this.$api.BASE_URL}/${this.$api.URL_NOTIFICATION_PUBLISHER}/test/${this.uuid}`; + let params = new URLSearchParams(); + params.append('destination', this.destination); + this.axios + .post(url, params, { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }) + .then((response) => { + this.alert = response.data; + this.$toastr.s(this.$t('admin.test_notification_queued')); + }) + .catch((error) => { + this.$toastr.w(this.$t('condition.unsuccessful_action')); + }); + }, updateProjectSelection: function (selections) { this.$root.$emit('bv::hide::modal', 'selectProjectModal'); for (let i = 0; i < selections.length; i++) {