update user and admin wallet function

This commit is contained in:
NW
2024-12-23 20:44:56 +00:00
parent a970a188db
commit 3129525a1e
7 changed files with 369 additions and 36 deletions

View File

@@ -18,6 +18,20 @@ class WalletService {
throw new Error('Failed to fetch archived wallets count');
}
}
// Добавляем метод для получения кошельков по типу
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');
}
}
}
export default WalletService;