mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
tweak(server/player): Added regex replace to getIdentifierByPhoneNumber
Added a regex replace to match the old signature for this function. Also migrated messages to use the new util function rather than a locally defined query
This commit is contained in:
1 parent
6e9c3e6d1a
commit
258ea66746
2 files changed
+3
-14
No files matched your search
@@ -35,7 +35,7 @@ export async function getIdentifierByPhoneNumber(
|
||||
}
|
||||
// Whether we fetch from database if not found in online players
|
||||
if (fetch) {
|
||||
const query = `SELECT identifier FROM users WHERE phone_number = ?`;
|
||||
const query = `SELECT identifier FROM users WHERE REGEXP_REPLACE(phone_number, '[^0-9]', '') = ? `;
|
||||
const [results] = await pool.query(query, [phoneNumber]);
|
||||
// Get identifier from results
|
||||
return (results as { identifier: string }[])[0].identifier;
|
||||
|
||||
Reference in new issue
Block a user