mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
more formatting
This commit is contained in:
1 parent
046447b0fb
commit
f552c1212c
157 files changed
+635
-1579
No files matched your search
@@ -2,23 +2,19 @@ import events from '../utils/events';
|
||||
import { ESX } from './server';
|
||||
import { getSource } from './functions';
|
||||
import { pool } from './db';
|
||||
import {
|
||||
Transfer,
|
||||
IBankCredentials,
|
||||
} from '../../phone/src/common/typings/bank';
|
||||
import { Transfer, IBankCredentials } from '../../phone/src/common/typings/bank';
|
||||
import { getIdentifier } from './functions';
|
||||
import { mainLogger } from './sv_logger';
|
||||
|
||||
const bankLogger = mainLogger.child({ module: 'bank' });
|
||||
|
||||
async function fetchAllTransactions(identifier: string): Promise<Transfer[]> {
|
||||
const query =
|
||||
'SELECT * FROM npwd_bank_transfers WHERE identifier = ? ORDER BY id DESC';
|
||||
const query = 'SELECT * FROM npwd_bank_transfers WHERE identifier = ? ORDER BY id DESC';
|
||||
const [results] = await pool.query(query, [identifier]);
|
||||
const transactions = <Transfer[]>results;
|
||||
|
||||
bankLogger.verbose(
|
||||
`Fetched all transactions (${identifier}) - ${JSON.stringify(transactions)}`
|
||||
`Fetched all transactions (${identifier}) - ${JSON.stringify(transactions)}`,
|
||||
);
|
||||
|
||||
return transactions;
|
||||
@@ -38,10 +34,7 @@ function fetchCredentials(): IBankCredentials {
|
||||
return result;
|
||||
}
|
||||
|
||||
async function addTransfer(
|
||||
identifier: string,
|
||||
transfer: Transfer
|
||||
): Promise<any> {
|
||||
async function addTransfer(identifier: string, transfer: Transfer): Promise<any> {
|
||||
const xPlayer = ESX.GetPlayerFromId(getSource());
|
||||
const bankBalance = xPlayer.getAccount('bank').money;
|
||||
const sourceName = xPlayer.getName();
|
||||
|
||||
Reference in new issue
Block a user