File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,10 +67,6 @@ export const POST = withRouteHandler(async (req: NextRequest) => {
6767 if ( ! queryValidation . success ) return queryValidation . response
6868 const { env : environment , endpoint } = queryValidation . data
6969
70- if ( ! endpoint ) {
71- return NextResponse . json ( { error : 'endpoint query param required' } , { status : 400 } )
72- }
73-
7470 if ( ! isValidEndpoint ( endpoint ) ) {
7571 return NextResponse . json ( { error : 'invalid endpoint' } , { status : 400 } )
7672 }
@@ -126,10 +122,6 @@ export const GET = withRouteHandler(async (req: NextRequest) => {
126122 if ( ! queryValidation . success ) return queryValidation . response
127123 const { env : environment , endpoint } = queryValidation . data
128124
129- if ( ! endpoint ) {
130- return NextResponse . json ( { error : 'endpoint query param required' } , { status : 400 } )
131- }
132-
133125 if ( ! isValidEndpoint ( endpoint ) ) {
134126 return NextResponse . json ( { error : 'invalid endpoint' } , { status : 400 } )
135127 }
Original file line number Diff line number Diff line change @@ -13,15 +13,15 @@ const logger = createLogger('TrelloAuthorize')
1313export const dynamic = 'force-dynamic'
1414
1515export const GET = withRouteHandler ( async ( request : NextRequest ) => {
16- const parsed = await parseRequest ( authorizeTrelloContract , request , { } )
17- if ( ! parsed . success ) return parsed . response
18-
1916 try {
2017 const session = await getSession ( )
2118 if ( ! session ?. user ?. id ) {
2219 return NextResponse . json ( { error : 'Unauthorized' } , { status : 401 } )
2320 }
2421
22+ const parsed = await parseRequest ( authorizeTrelloContract , request , { } )
23+ if ( ! parsed . success ) return parsed . response
24+
2525 const apiKey = env . TRELLO_API_KEY
2626
2727 if ( ! apiKey ) {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export const adminMothershipQuerySchema = z
108108 ( value ) => ( value === '' || value === undefined ? 'dev' : value ) ,
109109 z . string ( ) . min ( 1 ) . default ( 'dev' )
110110 ) ,
111- endpoint : z . preprocess ( ( value ) => ( value === '' ? undefined : value ) , z . string ( ) . optional ( ) ) ,
111+ endpoint : z . string ( ) . min ( 1 , 'endpoint query param required' ) ,
112112 } )
113113 . passthrough ( )
114114export type AdminMothershipQuery = z . output < typeof adminMothershipQuerySchema >
You can’t perform that action at this time.
0 commit comments