File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
document-processor/controllers Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,6 @@ export class DocumentProcessorController {
165165 return {
166166 success : true ,
167167 reportId : report . id ,
168- analysis : result . analysis ,
169168 } ;
170169 } catch ( error : unknown ) {
171170 this . logger . error (
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export class BackendStack extends cdk.Stack {
8787
8888 // Add GSI for querying by createdAt
8989 reportsTable . addGlobalSecondaryIndex ( {
90- indexName : 'userIdDateIndex ' ,
90+ indexName : 'userIdCreatedAtIndex ' ,
9191 partitionKey : {
9292 name : 'userId' ,
9393 type : AttributeType . STRING ,
@@ -431,6 +431,13 @@ export class BackendStack extends cdk.Stack {
431431 } ,
432432 } ) ;
433433
434+ const processFileIntegration = new apigateway . Integration ( {
435+ type : apigateway . IntegrationType . HTTP_PROXY ,
436+ integrationHttpMethod : 'POST' ,
437+ uri : `${ serviceUrl } /api/document-processor/process-file` ,
438+ options : integrationOptions ,
439+ } ) ;
440+
434441 // Define method options with authorization
435442 const methodOptions = {
436443 authorizer : authorizer ,
@@ -457,6 +464,14 @@ export class BackendStack extends cdk.Stack {
457464 } ,
458465 } ) ;
459466
467+ // Add POST method to process file
468+ reportIdResource . addMethod ( 'POST' , processFileIntegration , {
469+ ...methodOptions ,
470+ requestParameters : {
471+ 'method.request.path.id' : true ,
472+ } ,
473+ } ) ;
474+
460475 // Add CORS to each resource separately - after methods have been created
461476 const corsOptions = {
462477 allowOrigins : [ '*' ] ,
You can’t perform that action at this time.
0 commit comments