fix: add isAdmin delegate method to AdminHandler, fix exportCSV call in adminWalletsHandler
- AdminHandler.isAdmin() static method delegates to middleware/auth.js (index.js calls adminHandler.isAdmin() which needs a class method) - adminWalletsHandler: this.exportCSV() → this.handleExportCSV(callbackQuery) (exportCSV doesn't exist, handleExportCSV is the correct method)
This commit is contained in:
@@ -2,6 +2,10 @@ import { isAdmin } from '../../middleware/auth.js';
|
||||
import bot from "../../context/bot.js";
|
||||
|
||||
export default class AdminHandler {
|
||||
static isAdmin(userId) {
|
||||
return isAdmin(userId);
|
||||
}
|
||||
|
||||
static async handleAdminCommand(msg) {
|
||||
const chatId = msg.chat.id;
|
||||
|
||||
|
||||
@@ -510,7 +510,8 @@ export default class AdminWalletsHandler {
|
||||
} else {
|
||||
// Если баланс достаточный, продолжаем экспорт
|
||||
console.log(`[${new Date().toISOString()}] Commission balance sufficient, proceeding with export`);
|
||||
await this.exportCSV(chatId, walletType, wallets);
|
||||
await this.handleExportCSV(callbackQuery);
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[${new Date().toISOString()}] Error checking commission balance:`, error);
|
||||
|
||||
Reference in New Issue
Block a user