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

View File

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

View File

@ -28,10 +28,10 @@
rule="VnUser">
</vn-textfield>
<vn-textfield
vn-one
label="Recovery phone"
ng-model="$ctrl.user.recoveryPhone"
disabled="$root.user.id !== $ctrl.user.id"
vn-one
label="Recovery phone"
ng-model="$ctrl.user.recoveryPhone"
disabled="$root.user.id !== $ctrl.user.id"
>
</vn-textfield>
<vn-autocomplete