feat(phone/functions): useIdentifier hook

This commit is contained in:
chip committed 2020-10-30 00:36:23 +01:00
1 parent d1d06c47cb
commit a157ef0baa
1 file changed
+6
+6
View File
@@ -1,4 +1,5 @@
import { pool } from './db';
import { ESX, getSource } from './server';
interface IPhoneNumber {
phone_number: string;
@@ -9,4 +10,9 @@ export async function usePhoneNumber(identifier: string): Promise<string> {
const [results] = await pool.query(query, [identifier]);
const phoneNumber = <IPhoneNumber[]>results;
return phoneNumber[0].phone_number;
}
export async function useIdentifier(): Promise<string> {
const identifier = await ESX.GetPlayerFromId(getSource()).getIdentifier()
return identifier;
}