diff --git a/backend/src/controllers/withdrawalController.js b/backend/src/controllers/withdrawalController.js index e804567..65260bb 100644 --- a/backend/src/controllers/withdrawalController.js +++ b/backend/src/controllers/withdrawalController.js @@ -12,7 +12,7 @@ const withdrawalService = require('../services/withdrawalService'); const createWithdrawal = async (req, res) => { try { const userId = req.user.id; - const { amount, paymentMethod, paymentDetails } = req.body; + const { amount, currency, paymentMethod, paymentDetails } = req.body; // Validate required fields if (!amount || !paymentMethod || !paymentDetails) { @@ -27,6 +27,7 @@ const createWithdrawal = async (req, res) => { const withdrawal = await withdrawalService.createWithdrawal(userId, { amount, + currency, paymentMethod, paymentDetails, }); @@ -37,6 +38,7 @@ const createWithdrawal = async (req, res) => { id: withdrawal.id, withdrawalNo: withdrawal.withdrawalNo, amount: parseFloat(withdrawal.amount).toFixed(2), + currency: withdrawal.currency || 'CNY', paymentMethod: withdrawal.paymentMethod, status: withdrawal.status, createdAt: withdrawal.createdAt,