📸 Sync stripe subscriptions with space data (#1777)

This commit is contained in:
Luke Vella 2025-06-15 14:04:26 +02:00 committed by GitHub
parent 87ab11834a
commit 2fe17e7f32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 74 additions and 38 deletions

View file

@ -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;
}

View file

@ -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>;