File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
app/api/orgs/[orgId]/problems Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,11 @@ export async function POST(
3636 try {
3737 const orgId = await getOrgIdFromNameId ( NameIdSchema . parse ( params . orgId ) ) ;
3838 const body = await request . json ( ) ;
39+ console . log ( "body" , request . body ) ;
3940
4041 const { testCases, ...problemData } = body ;
41- const validatedProblem = createProblemSchema . parse ( problemData ) ;
42+ console . log ( "testCases" , testCases ) ;
43+ const validatedProblem = createProblemSchema . parse ( body ) ;
4244 const validatedTestCases = z
4345 . array ( createTestCaseSchema )
4446 . min ( 1 )
@@ -53,6 +55,7 @@ export async function POST(
5355 return NextResponse . json ( problem , { status : 201 } ) ;
5456 } catch ( error ) {
5557 if ( error instanceof z . ZodError ) {
58+ console . log ( error . errors ) ;
5659 return NextResponse . json ( { error : error . errors } , { status : 400 } ) ;
5760 }
5861 return NextResponse . json (
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ export async function createProblem(
3434 ) ;
3535 }
3636
37+ console . log ( "CREATE problem" , problem ) ;
38+
3739 return problem ;
3840 } ) ;
3941}
Original file line number Diff line number Diff line change @@ -181,6 +181,9 @@ export function ProblemEditor() {
181181 ? `/api/orgs/${ orgId } /problems/${ problemId } `
182182 : `/api/orgs/${ orgId } /problems` ;
183183
184+ console . log ( "data.testCases" , data . testCases ) ;
185+ console . log ( "isEdit" , isEdit ) ;
186+
184187 // Transform the data to match the API's expected format
185188 const apiData = {
186189 code : data . code ,
You can’t perform that action at this time.
0 commit comments