2
0

Add usage-based new pricing plans

This commit is contained in:
Baptiste Arnaud
2022-09-17 16:37:33 +02:00
committed by Baptiste Arnaud
parent 6a1eaea700
commit 898367a33b
144 changed files with 4631 additions and 1624 deletions

View File

@ -1,5 +1,5 @@
import { withSentry } from '@sentry/nextjs'
import { Workspace } from 'db'
import { Plan, Workspace } from 'db'
import prisma from 'libs/prisma'
import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from 'services/api/utils'
@ -22,7 +22,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
data: {
...data,
members: { create: [{ role: 'ADMIN', userId: user.id }] },
plan: process.env.ADMIN_EMAIL === user.email ? 'TEAM' : 'FREE',
plan:
process.env.ADMIN_EMAIL === user.email ? Plan.LIFETIME : Plan.FREE,
},
})
return res.status(200).json({