File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ export async function POST(request: NextRequest) {
26
26
const generatedFiles = await generateApp ( description ) ;
27
27
28
28
// // Parse through schema before passing to repair
29
- // const validatedFiles = benchifyFileSchema.parse(generatedFiles);
29
+ const validatedFiles = benchifyFileSchema . parse ( generatedFiles ) ;
30
30
31
31
// // Repair the generated code using Benchify's API
32
- // const repairedFiles = await repairCode(validatedFiles);
32
+ const repairedFiles = await repairCode ( validatedFiles ) ;
33
33
34
34
const { sbxId, template, url } = await createSandbox ( { files : generatedFiles } ) ;
35
35
@@ -38,7 +38,7 @@ export async function POST(request: NextRequest) {
38
38
// Return the results to the client
39
39
return NextResponse . json ( {
40
40
originalFiles : generatedFiles ,
41
- // repairedFiles: repairedFiles,
41
+ repairedFiles : repairedFiles ,
42
42
// buildOutput: '', // We don't get build output from Benchify in our current setup
43
43
previewUrl : url ,
44
44
} ) ;
Original file line number Diff line number Diff line change 1
1
// app/page.tsx
2
2
'use client' ;
3
3
4
- import { useState } from 'react' ;
4
+ import { useEffect , useState } from 'react' ;
5
5
import { PromptForm } from '@/components/ui-builder/prompt-form' ;
6
6
import { Card , CardContent } from '@/components/ui/card' ;
7
-
8
7
export default function Home ( ) {
9
8
const [ result , setResult ] = useState < any > ( null ) ;
10
9
10
+ useEffect ( ( ) => {
11
+ if ( result ) {
12
+ console . log ( result ) ;
13
+ }
14
+ } , [ result ] ) ;
15
+
11
16
return (
12
17
< main className = "min-h-screen flex flex-col items-center justify-center bg-background" >
13
18
< div className = "w-full max-w-3xl mx-auto" >
You can’t perform that action at this time.
0 commit comments