mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
📸 Sync stripe subscriptions with space data (#1777)
This commit is contained in:
parent
87ab11834a
commit
2fe17e7f32
6 changed files with 74 additions and 38 deletions
|
@ -28,11 +28,9 @@ export async function getDefaultSpace({ ownerId }: { ownerId: string }) {
|
|||
}
|
||||
|
||||
export async function getSpace({ id }: { id: string }) {
|
||||
const space = await prisma.space.findUnique({
|
||||
return await prisma.space.findUniqueOrThrow({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
|
||||
return space;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ export type SubscriptionCheckoutMetadata = z.infer<
|
|||
|
||||
export const subscriptionMetadataSchema = z.object({
|
||||
userId: z.string(),
|
||||
spaceId: z.string().optional(),
|
||||
spaceId: z.string(),
|
||||
});
|
||||
|
||||
export type SubscriptionMetadata = z.infer<typeof subscriptionMetadataSchema>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue