File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 11import { createFileRoute } from '@tanstack/react-router' ;
2+ import { json } from '@tanstack/react-start' ;
23import { getHookByToken , resumeHook } from 'workflow/api' ;
34
45export const Route = createFileRoute ( '/api/hook' ) ( {
@@ -14,8 +15,8 @@ export const Route = createFileRoute('/api/hook')({
1415 } catch ( error ) {
1516 console . log ( 'error during getHookByToken' , error ) ;
1617 // TODO: `WorkflowAPIError` is not exported, so for now
17- // we'll return 404 assuming it's the "invalid" token test case
18- return Response . json ( null , { status : 404 } ) ;
18+ // we'll return 400 assuming it's the "invalid" token test case
19+ return json ( null , { status : 400 } ) ;
1920 }
2021
2122 await resumeHook ( hook . token , {
@@ -24,7 +25,7 @@ export const Route = createFileRoute('/api/hook')({
2425 customData : hook . metadata ?. customData ,
2526 } ) ;
2627
27- return Response . json ( hook ) ;
28+ return json ( hook ) ;
2829 } ,
2930 } ,
3031 } ,
Original file line number Diff line number Diff line change 11import { createFileRoute } from '@tanstack/react-router' ;
2+ import { json } from '@tanstack/react-start' ;
23import { start } from 'workflow/api' ;
34import { handleUserSignup } from 'workflows/user-signup' ;
45
@@ -7,7 +8,7 @@ export const Route = createFileRoute('/api/signup')({
78 handlers : {
89 GET : async ( { request } ) => {
910 const run = await start ( handleUserSignup , [ 'test@example.com' ] ) ;
10- return Response . json ( run ) ;
11+ return json ( run ) ;
1112 } ,
1213 } ,
1314 } ,
Original file line number Diff line number Diff line change 11import { createFileRoute } from '@tanstack/react-router' ;
2+ import { json } from '@tanstack/react-start' ;
23import { allWorkflows } from '_workflows.js' ;
34import { getRun , start } from 'workflow/api' ;
45import { hydrateWorkflowArguments } from 'workflow/internal/serialization' ;
@@ -49,7 +50,7 @@ export const Route = createFileRoute('/api/trigger')({
4950 'Content-Type' : 'application/octet-stream' ,
5051 } ,
5152 } )
52- : Response . json ( returnValue ) ;
53+ : json ( returnValue ) ;
5354 } catch ( error ) {
5455 if ( error instanceof Error ) {
5556 if ( error . name === 'WorkflowRunNotCompletedError' ) {
Original file line number Diff line number Diff line change @@ -18,11 +18,6 @@ const config = defineConfig({
1818 tanstackStart ( ) ,
1919 viteReact ( ) ,
2020 ] ,
21- build : {
22- commonjsOptions : {
23- transformMixedEsModules : true ,
24- } ,
25- } ,
2621} ) ;
2722
2823export default config ;
You can’t perform that action at this time.
0 commit comments