mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
initial working version
This commit is contained in:
1 parent
b87baeb12e
commit
956070951a
23 files changed
+260
-107
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { ESX, getSource } from "./server";
|
||||
import { ESX } from "./server";
|
||||
import { pool } from "./db";
|
||||
import events from "../utils/events";
|
||||
import { useIdentifier } from './functions'
|
||||
import { useIdentifier, getSource } from './functions'
|
||||
|
||||
interface Contacts {
|
||||
id?: number;
|
||||
@@ -31,7 +31,8 @@ async function addContact(
|
||||
const query =
|
||||
"INSERT INTO npwd_phone_contacts (identifier, number, display, avatar) VALUES (?, ?, ?, ?)";
|
||||
|
||||
await pool.query(query, [identifier, number, display, avatar]);
|
||||
const [result] = await pool.query(query, [identifier, number, display, avatar]);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function updateContact(contact: Contacts, identifier: string): Promise<any> {
|
||||
@@ -70,6 +71,7 @@ onNet(events.CONTACTS_ADD_CONTACT, async (number: string, display: string, avata
|
||||
try {
|
||||
const _source = (global as any).source;
|
||||
const _identifier = await useIdentifier()
|
||||
console.log(number, display);
|
||||
addContact(_identifier, number, display, avatar);
|
||||
emitNet(events.CONTACTS_ADD_CONTACT_SUCCESS, _source)
|
||||
|
||||
|
||||
Reference in new issue
Block a user