mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
feat(phone/functions): useIdentifier hook
This commit is contained in:
1 parent
d1d06c47cb
commit
a157ef0baa
1 file changed
+6
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user