2
0

♻️ (billing) Refactor billing server code to trpc

This commit is contained in:
Baptiste Arnaud
2023-02-17 16:19:39 +01:00
parent 962438768e
commit b73282d810
38 changed files with 1565 additions and 367 deletions

View File

@ -10,6 +10,7 @@ import { getAuthenticatedUser } from '@/features/auth/api'
import prisma from '@/lib/prisma'
import { WorkspaceRole } from 'db'
// TO-DO: Delete
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await getAuthenticatedUser(req)
if (!user) return notAuthenticated(res)

View File

@ -10,6 +10,7 @@ import { getAuthenticatedUser } from '@/features/auth/api'
import prisma from '@/lib/prisma'
import { WorkspaceRole } from 'db'
// TODO: Delete
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await getAuthenticatedUser(req)
if (!user) return notAuthenticated(res)

View File

@ -11,6 +11,7 @@ import { getAuthenticatedUser } from '@/features/auth/api'
import prisma from '@/lib/prisma'
import { Plan, WorkspaceRole } from 'db'
// TODO: Delete
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await getAuthenticatedUser(req)
if (!user) return notAuthenticated(res)

View File

@ -11,5 +11,9 @@ export default createNextApiHandler({
captureException(error)
console.error('Something went wrong', error)
}
return error
},
batching: {
enabled: true,
},
})

View File

@ -3,6 +3,7 @@ import { NextApiRequest, NextApiResponse } from 'next'
import { getAuthenticatedUser } from '@/features/auth/api'
import { methodNotAllowed, notAuthenticated } from 'utils/api'
// TODO: Delete
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
const user = await getAuthenticatedUser(req)
if (!user) return notAuthenticated(res)