Skip to content

Commit edb8db3

Browse files
authored
Merge pull request #77 from ModusCreateOrg/NO-TICKET-FIX-DYNAMODB-GSI
Rename GSI from 'userIdDateIndex' to 'userIdCreatedAtIndex' for clarity
2 parents ed334bd + 874ba61 commit edb8db3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

backend/src/document-processor/controllers/document-processor.controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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(

backend/src/iac/backend-stack.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff 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: ['*'],

0 commit comments

Comments
 (0)