@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
import * as Sentry from '@sentry/nextjs'
|
||||
import { NextPageContext } from 'next'
|
||||
import NextErrorComponent from 'next/error'
|
||||
|
||||
const CustomErrorComponent = (props: {
|
||||
@ -31,7 +32,7 @@ const CustomErrorComponent = (props: {
|
||||
return <NextErrorComponent statusCode={props.statusCode} />
|
||||
}
|
||||
|
||||
CustomErrorComponent.getInitialProps = async (contextData: any) => {
|
||||
CustomErrorComponent.getInitialProps = async (contextData: NextPageContext) => {
|
||||
// In case this is running in a serverless function, await this in order to give Sentry
|
||||
// time to send the error before the lambda exits
|
||||
await Sentry.captureUnderscoreErrorException(contextData)
|
||||
|
@ -13,7 +13,9 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const domain = req.query.domain as string
|
||||
try {
|
||||
await deleteDomainOnVercel(domain)
|
||||
} catch {}
|
||||
} catch {
|
||||
/* empty */
|
||||
}
|
||||
const customDomains = await prisma.customDomain.delete({
|
||||
where: { name: domain },
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { captureException, withSentry } from '@sentry/nextjs'
|
||||
import { captureException } from '@sentry/nextjs'
|
||||
import { SmtpCredentialsData } from 'models'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { createTransport } from 'nodemailer'
|
||||
|
@ -2,7 +2,7 @@ import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { drive } from '@googleapis/drive'
|
||||
import { getAuthenticatedGoogleClient } from '@/lib/googleSheets'
|
||||
import { badRequest, methodNotAllowed, notAuthenticated } from 'utils/api'
|
||||
import { setUser, withSentry } from '@sentry/nextjs'
|
||||
import { setUser } from '@sentry/nextjs'
|
||||
import { getAuthenticatedUser } from '@/features/auth/api'
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
@ -3,7 +3,7 @@ import { GoogleSpreadsheet } from 'google-spreadsheet'
|
||||
import { getAuthenticatedGoogleClient } from '@/lib/googleSheets'
|
||||
import { isDefined } from 'utils'
|
||||
import { badRequest, methodNotAllowed, notAuthenticated } from 'utils/api'
|
||||
import { withSentry, setUser } from '@sentry/nextjs'
|
||||
import { setUser } from '@sentry/nextjs'
|
||||
import { getAuthenticatedUser } from '@/features/auth/api'
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
|
@ -5,6 +5,7 @@ import Cors from 'micro-cors'
|
||||
import { buffer } from 'micro'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { Plan } from 'db'
|
||||
import { RequestHandler } from 'next/dist/server/next'
|
||||
|
||||
if (!process.env.STRIPE_SECRET_KEY || !process.env.STRIPE_WEBHOOK_SECRET)
|
||||
throw new Error('STRIPE_SECRET_KEY or STRIPE_WEBHOOK_SECRET missing')
|
||||
@ -127,4 +128,4 @@ const webhookHandler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
return methodNotAllowed(res)
|
||||
}
|
||||
|
||||
export default cors(webhookHandler as any)
|
||||
export default cors(webhookHandler as RequestHandler)
|
||||
|
Reference in New Issue
Block a user