feat(sellout/server): using usePhoneNumber hook

This commit is contained in:
chip committed 2020-10-20 01:20:42 +02:00
1 parent 86f5741618
commit 2d94b5ec8c
1 file changed
+6 -4
+6 -4
View File
@@ -8,7 +8,7 @@ import { usePhoneNumber } from './functions';
interface Listing {
title: string;
name: string;
url: string;
url?: 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 {
const xPlayer = ESX.GetPlayerFromId(getSource())
const _identifier = xPlayer.getIdentifier()
const name = xPlayer.getName()
const number = "3333333" //usePhoneNumber(_identifier)
addListing(_identifier, name, number, listing)
const phoneNumber = await usePhoneNumber(_identifier)
console.log(phoneNumber)
const number = "3333333"
addListing(_identifier, name, phoneNumber, listing)
} catch (error) {
console.log("Failed to add contact: ", error)
}