Skip to content

Commit

Permalink
feat(api): generate preview working as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Nov 4, 2024
1 parent 4961657 commit f7df07f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/api/src/app/workflows-v2/generate-preview.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ describe('Generate Preview', () => {
): Promise<GeneratePreviewResponseDto> {
const novuRestResult = await workflowsClient.generatePreview(workflowId, stepDatabaseId, dto);
if (novuRestResult.isSuccessResult()) {
console.log('previewResponseDto.exampleMasterPayload', novuRestResult.value.exampleMasterPayload);

return novuRestResult.value;
}

throw await assertHttpError(description, novuRestResult);
}

Expand Down Expand Up @@ -267,7 +270,7 @@ function buildSimpleForEmail(): EmailStepControlSchemaDto {
}
function buildInAppControlValues(): InAppOutput {
return {
subject: `Hello, World! ${PLACEHOLDER_SUBJECT_INAPP}`,
subject: `{{subscriber.firstName}} Hello, World! ${PLACEHOLDER_SUBJECT_INAPP}`,
body: 'Hello, World! {{payload.placeholder.body}}',
avatar: 'https://www.example.com/avatar.png',
primaryAction: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ConstructPayloadFromPlaceholdersWithDefaultsUseCase {
}

return {
augmentedPayload: _.merge(aggregatedDefaultValues, payloadValues),
augmentedPayload: _.merge(aggregatedDefaultValues, { payload: payloadValues }),
issues: this.buildVariableMissingIssueRecord(
aggregatedDefaultValuesForControl,
aggregatedDefaultValues,
Expand Down

0 comments on commit f7df07f

Please sign in to comment.