tapshil
tapshil
// --- Admin Panel for Viewing Payments --- import React, { useEffect, useState } from 'react'; import axios from 'axios'; function AdminPayments() { const [payments, setPayments] = useState([]); useEffect(() => { axios.get('http://localhost:5000/api/payments') .then(res => setPayments(res.data)) .catch(err => console.error('Error fetching payments', err)); }, []); return (); } export default AdminPayments; // --- Backend GET Route to fetch payments --- // Add to server/index.js: app.use('/uploads', express.static('uploads')); app.get('/api/payments', async (req, res) => { const payments = await Payment.find().sort({ createdAt: -1 }); res.json(payments); });पेमेंट तपशील
{payments.map(payment => ())}नाव: {payment.name}
रक्कम: ₹{payment.amount}
![]()
{new Date(payment.createdAt).toLocaleString()}
Admin Panel मध्ये आता सर्व पेमेंट सबमिशन्स दिसतील – नाव, रक्कम, आणि स्क्रीनशॉटसह.
ज्यावेळी तुम्ही याचा सर्व्हर चालू करता:
- Screenshot
uploads/
फोल्डरमध्ये सेव्ह होईल http://localhost:5000/uploads/<filename>
लिंक React मध्ये वापरली जाते
आता हवं असल्यास:
- पेमेंट Status बदलण्याचा ऑप्शन (Pending/Approved)
- ऑर्डरशी लिंक करणं
- एक्सेलमध्ये एक्सपोर्ट
हे featuresही अॅड करून देतो. सांगा हवंय का?
0 comments :
Please do not enter any spam link in the comment box.