first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
17
apps/web/modules/saas/payments/lib/server.ts
Normal file
17
apps/web/modules/saas/payments/lib/server.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { getServerApiClient } from "@shared/lib/server";
|
||||
import { cache } from "react";
|
||||
|
||||
export const getPurchases = cache(async (organizationId?: string) => {
|
||||
const apiClient = await getServerApiClient();
|
||||
const response = await apiClient.payments.purchases.$get({
|
||||
query: {
|
||||
organizationId,
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch purchases");
|
||||
}
|
||||
|
||||
return response.json();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue