MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / fetchpayments

Function fetchpayments

Video 131/actions/useractions.js:41–46  ·  view source on GitHub ↗
(username)

Source from the content-addressed store, hash-verified

39}
40
41export 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
48export const updateProfile = async (data, oldusername) => {
49 await connectDb()

Callers 1

getDataFunction · 0.90

Calls 1

connectDbFunction · 0.85

Tested by

no test coverage detected