perf(salix): refs #6427 #6427 comments
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-10-02 11:28:34 +02:00
parent a0fb7b1d8e
commit 580c2c6f10
3 changed files with 12 additions and 10 deletions

View File

@ -6,10 +6,11 @@ module.exports = Self => {
Self.send = async(senderFk, destination, message, options) => { Self.send = async(senderFk, destination, message, options) => {
const smsConfig = await models.SmsConfig.findOne(); const smsConfig = await models.SmsConfig.findOne();
if (destination.length == 9) { const [{prefix: spainPrefix}] = await Self.rawSql(
const spainPrefix = '0034'; 'SELECT prefix FROM pbx.prefix WHERE country = ?', ['es'], options
);
if (destination.length == 9)
destination = spainPrefix + destination; destination = spainPrefix + destination;
}
const params = { const params = {
api_key: smsConfig.apiKey, api_key: smsConfig.apiKey,
@ -34,7 +35,7 @@ module.exports = Self => {
console.error(e); console.error(e);
} }
if (!options?.insert) return; if (!options?.insert) return;
// return response;
const [result] = response.result; const [result] = response.result;
const error = result.error_id; const error = result.error_id;

View File

@ -30,8 +30,9 @@
val="email" val="email"
ng-model="$ctrl.method" ng-model="$ctrl.method"
> >
</vn-radio></vn-vertical </vn-radio>
></vn-one> </vn-vertical>
</vn-one>
<div class="text-secondary" ng-if="$ctrl.method && $ctrl.user"> <div class="text-secondary" ng-if="$ctrl.method && $ctrl.user">
<span ng-if="$ctrl.method ==='sms'" translate> <span ng-if="$ctrl.method ==='sms'" translate>
We will sent you a sms to recover your password We will sent you a sms to recover your password