udpdate wallet function

This commit is contained in:
NW
2024-12-24 09:19:14 +00:00
parent 3129525a1e
commit c9bcb09221
6 changed files with 155 additions and 69 deletions

View File

@@ -20,18 +20,20 @@ class WalletService {
}
// Добавляем метод для получения кошельков по типу
static async getWalletsByType(walletType) {
try {
const wallets = await db.allAsync(
`SELECT * FROM crypto_wallets WHERE wallet_type = ?`,
[walletType]
);
return wallets;
} catch (error) {
console.error('Error fetching wallets by type:', error);
throw new Error('Failed to fetch wallets by type');
try {
const wallets = await db.allAsync(
`SELECT *
FROM crypto_wallets
WHERE wallet_type = ?`,
[walletType]
);
return wallets;
} catch (error) {
console.error('Error fetching wallets by type:', error);
throw new Error('Failed to fetch wallets by type');
}
}
}
}
export default WalletService;