diff --git a/src/pages/api/autoRedirectToLocalisedPage.ts b/src/pages/api/autoRedirectToLocalisedPage.ts index c8fd0e64..9f73a713 100644 --- a/src/pages/api/autoRedirectToLocalisedPage.ts +++ b/src/pages/api/autoRedirectToLocalisedPage.ts @@ -4,7 +4,7 @@ import { AMPLITUDE_EVENTS, } from '@/modules/core/amplitude/events'; import localeMiddleware from '@/modules/core/i18n/middlewares/localeMiddleware'; -import { withSentry } from '@sentry/nextjs'; +import * as Sentry from '@sentry/nextjs'; import { NextApiRequest, NextApiResponse, @@ -28,5 +28,5 @@ const autoRedirectToLocalisedPage = async (req: NextApiRequest, res: NextApiResp return await localeMiddleware(req, res); }; -export default withSentry(autoRedirectToLocalisedPage); +export default Sentry.withSentry(autoRedirectToLocalisedPage); diff --git a/src/pages/api/error.ts b/src/pages/api/error.ts index c49401e2..5ce2032a 100644 --- a/src/pages/api/error.ts +++ b/src/pages/api/error.ts @@ -49,4 +49,4 @@ export const error = async (req: NextApiRequest, res: NextApiResponse): Promise< } }; -export default error; +export default Sentry.withSentry(error); diff --git a/src/pages/api/preview.ts b/src/pages/api/preview.ts index 561ee2fc..d6086567 100644 --- a/src/pages/api/preview.ts +++ b/src/pages/api/preview.ts @@ -120,4 +120,4 @@ export const preview = async (req: EndpointRequest, res: NextApiResponse): Promi } }; -export default preview; +export default Sentry.withSentry(preview); diff --git a/src/pages/api/startVercelDeployment.ts b/src/pages/api/startVercelDeployment.ts index b04d3dc1..3e3e05fb 100644 --- a/src/pages/api/startVercelDeployment.ts +++ b/src/pages/api/startVercelDeployment.ts @@ -8,6 +8,7 @@ import dispatchWorkflowByPath from '@/modules/core/githubActions/dispatchWorkflo import { createLogger } from '@/modules/core/logging/logger'; import { ALERT_TYPES } from '@/modules/core/sentry/config'; import { configureReq } from '@/modules/core/sentry/server'; +import { flushSafe } from '@/modules/core/sentry/universal'; import * as Sentry from '@sentry/nextjs'; import size from 'lodash.size'; import { diff --git a/src/pages/api/status.ts b/src/pages/api/status.ts index 309297a9..690f9c0c 100644 --- a/src/pages/api/status.ts +++ b/src/pages/api/status.ts @@ -72,4 +72,4 @@ export const status = async (req: NextApiRequest, res: NextApiResponse): Promise } }; -export default status; +export default Sentry.withSentry(status); diff --git a/src/pages/api/webhooks/deploymentCompleted.ts b/src/pages/api/webhooks/deploymentCompleted.ts index fb9e3c14..f13ca422 100644 --- a/src/pages/api/webhooks/deploymentCompleted.ts +++ b/src/pages/api/webhooks/deploymentCompleted.ts @@ -133,4 +133,4 @@ export const deploymentCompleted = async (req: EndpointRequest, res: NextApiResp } }; -export default deploymentCompleted; +export default Sentry.withSentry(deploymentCompleted);