0
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-28 10:36:39 +01:00

Don't use then with await.

This commit is contained in:
Lukas 2021-10-08 11:49:12 +02:00 committed by GitHub
parent dfd63386ba
commit db791c880a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {