MCPcopy Index your code
hub / github.com/sqlchat/sqlchat / getPaymentListByEmail

Function getPaymentListByEmail

src/pages/api/utils/payment.ts:6–25  ·  view source on GitHub ↗
(email: string)

Source from the content-addressed store, hash-verified

4const prisma = new PrismaClient();
5
6export const getPaymentListByEmail = async (email: string): Promise<Payment[]> => {
7 const payments = await prisma.payment.findMany({
8 where: { email: email },
9 orderBy: { createdAt: "desc" },
10 });
11
12 const result: Payment[] = [];
13 for (const payment of payments) {
14 result.push({
15 id: payment.id,
16 email: payment.email,
17 createdAt: payment.createdAt.getTime(),
18 amount: payment.amount,
19 currency: payment.currency,
20 receipt: payment.receipt,
21 description: payment.description,
22 });
23 }
24 return result;
25};

Callers 1

handlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected