Skip to content

Commit 7b2757a

Browse files
authored
fix: template content generation (#1716)
* feat: template-content-generation * fix(workflow-app): inject CanvasService in template processor to fix getWorkflowVariables call * fix: update prevTemplateContent * fix: templateResult Valid * fix: upload * fix(workflow-app): update shared storage for all share records without duplicate staticFile entries - Use direct putObject instead of uploadBuffer to avoid creating duplicate staticFile records - Update all share records (regular share + template share) instead of only the latest one - Add JSON data validation to prevent invalid structure updates - Improve error logging with stack trace for better debugging - Add independent error handling for each share record * feat: optimize prompt
1 parent b57ea68 commit 7b2757a

File tree

5 files changed

+449
-107
lines changed

5 files changed

+449
-107
lines changed

apps/api/src/modules/share/share-creation.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,12 @@ export class ShareCreationService {
12861286
throw new ShareNotFoundError();
12871287
}
12881288

1289+
// Get workflow variables from Canvas service
1290+
const variables = await this.canvasService.getWorkflowVariables(user, {
1291+
canvasId: workflowApp.canvasId,
1292+
});
1293+
workflowApp.variables = JSON.stringify(variables) ?? '[]';
1294+
12891295
// Use creditUsage from database if available (already has markup applied),
12901296
// otherwise calculate from param (apply markup if needed)
12911297
let finalCreditUsage: number;

0 commit comments

Comments
 (0)