🔥 Remove useless stripe env check for usage
This commit is contained in:
@@ -22,15 +22,6 @@ export const getUsage = authenticatedProcedure
|
|||||||
z.object({ totalChatsUsed: z.number(), totalStorageUsed: z.number() })
|
z.object({ totalChatsUsed: z.number(), totalStorageUsed: z.number() })
|
||||||
)
|
)
|
||||||
.query(async ({ input: { workspaceId }, ctx: { user } }) => {
|
.query(async ({ input: { workspaceId }, ctx: { user } }) => {
|
||||||
if (
|
|
||||||
!process.env.STRIPE_SECRET_KEY ||
|
|
||||||
!process.env.STRIPE_ADDITIONAL_CHATS_PRICE_ID ||
|
|
||||||
!process.env.STRIPE_ADDITIONAL_STORAGE_PRICE_ID
|
|
||||||
)
|
|
||||||
throw new TRPCError({
|
|
||||||
code: 'INTERNAL_SERVER_ERROR',
|
|
||||||
message: 'Stripe environment variables are missing',
|
|
||||||
})
|
|
||||||
const workspace = await prisma.workspace.findFirst({
|
const workspace = await prisma.workspace.findFirst({
|
||||||
where: {
|
where: {
|
||||||
id: workspaceId,
|
id: workspaceId,
|
||||||
|
|||||||
Reference in New Issue
Block a user