mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
fix(resources/server): changed credentials return type
This commit is contained in:
1 parent
eb5b907091
commit
4ef89f679f
1 file changed
+1
-5
@@ -5,14 +5,10 @@ import PlayerService from './players/player.service';
|
|||||||
import { getSource } from './utils/miscUtils';
|
import { getSource } from './utils/miscUtils';
|
||||||
import { config } from './server';
|
import { config } from './server';
|
||||||
|
|
||||||
interface Credentials {
|
|
||||||
phone_number: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function getCredentials(identifier: string): Promise<string> {
|
async function getCredentials(identifier: string): Promise<string> {
|
||||||
const query = `SELECT phone_number FROM ${config.database.playerTable} WHERE ${config.database.identifierColumn} = ?`;
|
const query = `SELECT phone_number FROM ${config.database.playerTable} WHERE ${config.database.identifierColumn} = ?`;
|
||||||
const [result] = await pool.query(query, [identifier]);
|
const [result] = await pool.query(query, [identifier]);
|
||||||
const number = <Credentials[]>result;
|
const number = <any[]>result;
|
||||||
if (number.length === 0) return '###-####';
|
if (number.length === 0) return '###-####';
|
||||||
return number[0].phone_number;
|
return number[0].phone_number;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user