-Quando insersci l'username telegram sul Profilo, devo togliergli la chiocciola !

- anche nella ricerca User
This commit is contained in:
Surya Paolo
2024-02-28 17:04:28 +01:00
parent e809195f60
commit b60f0f9e34

View File

@@ -2068,6 +2068,10 @@ module.exports = {
data[rec.field] = filter.trim();
} else if (rec.type === this.FieldType.string) {
data[rec.field] = myregexp;
if (rec.field === 'profile.username_telegram') {
myregexp = new RegExp(this.rimuoviAtPrimoCarattere(filter).trim().replace(' ', '|'), 'ig');
data[rec.field] = myregexp
}
} else if ((rec.type === this.FieldType.number) ||
(rec.type === this.FieldType.hours)) {
data[rec.field] = parseFloat(filter.trim());
@@ -4813,6 +4817,14 @@ module.exports = {
miastr = miastr.replace(/<br>$/, '');
return miastr;
}
},
rimuoviAtPrimoCarattere(stringa) {
if (stringa.charAt(0) === '@') {
return stringa.slice(1);
} else {
return stringa;
}
},
};