mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
feat(sellout/server): using usePhoneNumber hook
This commit is contained in:
1 parent
86f5741618
commit
2d94b5ec8c
1 file changed
+6
-4
@@ -8,7 +8,7 @@ import { usePhoneNumber } from './functions';
|
|||||||
interface Listing {
|
interface Listing {
|
||||||
title: string;
|
title: string;
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url?: string;
|
||||||
description: string;
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,14 +47,16 @@ onNet(events.SELLOUT_FETCH_LISTING, async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onNet(events.SELLOUT_ADD_LISTING, (listing: Listing) => {
|
onNet(events.SELLOUT_ADD_LISTING, async (listing: Listing) => {
|
||||||
try {
|
try {
|
||||||
const xPlayer = ESX.GetPlayerFromId(getSource())
|
const xPlayer = ESX.GetPlayerFromId(getSource())
|
||||||
const _identifier = xPlayer.getIdentifier()
|
const _identifier = xPlayer.getIdentifier()
|
||||||
const name = xPlayer.getName()
|
const name = xPlayer.getName()
|
||||||
|
|
||||||
const number = "3333333" //usePhoneNumber(_identifier)
|
const phoneNumber = await usePhoneNumber(_identifier)
|
||||||
addListing(_identifier, name, number, listing)
|
console.log(phoneNumber)
|
||||||
|
const number = "3333333"
|
||||||
|
addListing(_identifier, name, phoneNumber, listing)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Failed to add contact: ", error)
|
console.log("Failed to add contact: ", error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user