fix: issues in organization build.

This commit is contained in:
Ahmed Bouhuolia
2020-09-05 15:12:38 +02:00
parent 481ca8aa8b
commit 79b7a02f85
10 changed files with 65 additions and 38 deletions

View File

@@ -11,15 +11,14 @@ export default class EasySMSClient implements SMSClientInterface {
* @param {string} message
*/
send(to: string, message: string) {
console.log(config);
const API_KEY = config.easySMSGateway.api_key;
const params = `action=send-sms&api_key=${API_KEY}=&to=${to}&sms=${message}&unicode=1`;
return new Promise((resolve, reject) => {
axios.get(`https://easysms.devs.ly/sms/api?${params}`)
.then((response) => {
if (response.code === 'ok') { resolve(); }
else { reject(); }
if (response.data.code === 'ok') { resolve(); }
else { reject(response.data); }
})
.catch((error) => { reject(error) });
});