✨ Allow user to share a flow publicly and make it duplicatable
Closes #360
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { createContext } from '@/helpers/server/context'
|
||||
import { trpcRouter } from '@/helpers/server/routers/v1/trpcRouter'
|
||||
import * as Sentry from '@sentry/nextjs'
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
import { createOpenApiNextHandler } from 'trpc-openapi'
|
||||
import cors from 'nextjs-cors'
|
||||
import { publicRouter } from '@/helpers/server/routers/publicRouter'
|
||||
|
||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
await cors(req, res, {
|
||||
@@ -11,7 +11,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
})
|
||||
|
||||
return createOpenApiNextHandler({
|
||||
router: trpcRouter,
|
||||
router: publicRouter,
|
||||
createContext,
|
||||
onError({ error }) {
|
||||
if (error.code === 'INTERNAL_SERVER_ERROR') {
|
||||
@@ -1,10 +1,10 @@
|
||||
import { createContext } from '@/helpers/server/context'
|
||||
import { trpcRouter } from '@/helpers/server/routers/v1/trpcRouter'
|
||||
import { appRouter } from '@/helpers/server/routers/appRouter'
|
||||
import * as Sentry from '@sentry/nextjs'
|
||||
import { createNextApiHandler } from '@trpc/server/adapters/next'
|
||||
|
||||
export default createNextApiHandler({
|
||||
router: trpcRouter,
|
||||
router: appRouter,
|
||||
createContext,
|
||||
onError({ error }) {
|
||||
if (error.code === 'INTERNAL_SERVER_ERROR') {
|
||||
|
||||
Reference in New Issue
Block a user