(username)
| 39 | } |
| 40 | |
| 41 | export const fetchpayments = async (username) => { |
| 42 | await connectDb() |
| 43 | // find all payments sorted by decreasing order of amount and flatten object ids |
| 44 | let p = await Payment.find({ to_user: username, done:true }).sort({ amount: -1 }).limit(10).lean() |
| 45 | return p |
| 46 | } |
| 47 | |
| 48 | export const updateProfile = async (data, oldusername) => { |
| 49 | await connectDb() |