Download src/controllers/walletController.js from Huzaifa1313/professional_final_2026: direct link, hf CLI and curl.
- Browser
- Download file 726 Bytes
-
https://huggingface.co/spaces/Huzaifa1313/professional_final_2026/resolve/main/src/controllers/walletController.js
- Command line
-
hf download hf://spaces/Huzaifa1313/professional_final_2026/src/controllers/walletController.js
-
curl -L -o walletController.js https://huggingface.co/spaces/Huzaifa1313/professional_final_2026/resolve/main/src/controllers/walletController.js
726 Bytes
| const { deductCommission } = require('../services/walletService'); | |
| const WalletController = { | |
| async deduct(req, res) { | |
| try { | |
| const result = await deductCommission(req.body || {}); | |
| if (!result.success) { | |
| return res.status(result.statusCode || 400).json({ | |
| success: false, | |
| message: result.message || 'Failed to deduct wallet commission.', | |
| }); | |
| } | |
| return res.status(200).json({ success: true, data: result.data }); | |
| } catch (error) { | |
| console.error('wallet deduct error:', error); | |
| return res.status(500).json({ | |
| success: false, | |
| message: 'Failed to deduct wallet commission.', | |
| }); | |
| } | |
| }, | |
| }; | |
| module.exports = WalletController; | |