Skip to content

Commit

Permalink
fix(api): fix commandException
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Oct 22, 2024
1 parent 7a59054 commit 48b595d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions apps/api/src/app/workflows-v2/generate-preview.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('Generate Preview', () => {
const { stepUuid, workflowId } = await createWorkflowAndReturnId(type);
const requestDto = buildDtoWithPayload(type);
const previewResponseDto = await generatePreview(workflowId, stepUuid, requestDto, description);
console.log('previewResponseDto', JSON.stringify(previewResponseDto));
expect(previewResponseDto.result!.preview).to.exist;
const expectedRenderedResult = buildInAppControlValues();
expectedRenderedResult.subject = buildInAppControlValues().subject!.replace(
Expand All @@ -66,7 +65,6 @@ describe('Generate Preview', () => {
const previewResponseDto = await generatePreview(workflowId, stepUuid, requestDto, description);
expect(previewResponseDto.result!.preview).to.exist;
expect(previewResponseDto.issues).to.exist;
console.log('previewResponseDto.issues', JSON.stringify(previewResponseDto.issues));

if (type !== StepTypeEnum.EMAIL) {
expect(previewResponseDto.result!.preview).to.deep.equal(stepTypeTo[type]);
Expand Down Expand Up @@ -107,7 +105,6 @@ describe('Generate Preview', () => {
dto: GeneratePreviewRequestDto,
description: string
): Promise<GeneratePreviewResponseDto> {
console.log('dto', JSON.stringify(dto, null, 2));
const novuRestResult = await workflowsClient.generatePreview(workflowId, stepUuid, dto);
if (novuRestResult.isSuccessResult()) {
return novuRestResult.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,12 @@ export class GeneratePreviewUsecase {
let aggregatedDefaultValues = {};
const aggregatedDefaultValuesForControl: Record<string, Record<string, unknown>> = {};
const flattenedValues = flattenJson(dto.controlValues);
console.log('flattenedValues', flattenedValues);
for (const controlValueKey in flattenedValues) {
if (flattenedValues.hasOwnProperty(controlValueKey)) {
console.log('controlValueKey', controlValueKey);

const defaultValuesForSingleControlValue = this.createMockPayloadUseCase.execute({
controlValues: flattenedValues,
controlValueKey,
});
console.log('defaultValuesForSingleControlValue', defaultValuesForSingleControlValue);

if (defaultValuesForSingleControlValue) {
aggregatedDefaultValuesForControl[controlValueKey] = defaultValuesForSingleControlValue;
Expand Down

0 comments on commit 48b595d

Please sign in to comment.