From db791c880a57971a1afe38bb7188e5d937e0a4ce Mon Sep 17 00:00:00 2001 From: Lukas <35193662+NixNotCastey@users.noreply.github.com> Date: Fri, 8 Oct 2021 11:49:12 +0200 Subject: [PATCH] Don't use then with await. --- server/notification-providers/promosms.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/notification-providers/promosms.js b/server/notification-providers/promosms.js index 23d6a4502..362ef714a 100644 --- a/server/notification-providers/promosms.js +++ b/server/notification-providers/promosms.js @@ -24,12 +24,12 @@ class PromoSMS extends NotificationProvider { "sender": notification.promosmsSenderName }; - await axios.post("https://promosms.com/api/rest/v3_2/sms", data, config).then(resp => { - if (resp.data.response.status !== 0) { - let error = "Something gone wrong. Api returned " + resp.data.response.status + "."; - this.throwGeneralAxiosError(error); - } - }); + let resp = await axios.post("https://promosms.com/api/rest/v3_2/sms", data, config); + + if (resp.data.response.status !== 0) { + let error = "Something gone wrong. Api returned " + resp.data.response.status + "."; + this.throwGeneralAxiosError(error); + } return okMsg; } catch (error) {