new version

This commit is contained in:
ZOMBIIIIIII
2026-04-14 20:22:51 +03:00
parent 37146f7375
commit 89cb6174b7
144 changed files with 1710 additions and 17258 deletions

View File

@@ -1,17 +1,10 @@
import { Request, Response } from 'express';
import { UserModel } from '../models/user.model';
import { WalletModel } from '../models/wallet.model';
export const WalletController = {
async getWallets(req: Request, res: Response) {
try {
const user = await UserModel.findByBitokUserId(req.user!.bitokUserId);
if (!user) {
res.status(404).json({ success: false, error: 'User not found' });
return;
}
const wallets = await WalletModel.findByUserId(user.id);
const wallets = await WalletModel.findByUserId(req.auth!.userId);
res.json({
success: true,
data: wallets.map((w) => ({