first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
21
packages/api/src/routes/payments/lib/purchases.ts
Normal file
21
packages/api/src/routes/payments/lib/purchases.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import {
|
||||
getPurchasesByOrganizationId,
|
||||
getPurchasesByUserId,
|
||||
} from "@repo/database";
|
||||
|
||||
export const getPurchases = async (
|
||||
props: { organizationId: string } | { userId: string },
|
||||
) => {
|
||||
if ("organizationId" in props) {
|
||||
const { organizationId } = props;
|
||||
const purchases = await getPurchasesByOrganizationId(organizationId);
|
||||
|
||||
return purchases;
|
||||
}
|
||||
|
||||
const { userId } = props;
|
||||
|
||||
const purchases = await getPurchasesByUserId(userId);
|
||||
|
||||
return purchases;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue