Skip to content

Commit

Permalink
fix: merge next
Browse files Browse the repository at this point in the history
  • Loading branch information
djabarovgeorge committed Nov 19, 2024
1 parent 494527b commit d9a6cb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export class PatchStepUsecase {
}

private async patchFieldsOnPersistedItems(command: PatchStepCommand, persistedItems: ValidNotificationWorkflow) {
if (command.name !== undefined && command.name !== null) {
if (command.name !== undefined) {
await this.updateName(persistedItems, command);
}

if (command.controlValues !== undefined && command.controlValues !== null) {
if (command.controlValues !== undefined) {
await this.updateControlValues(persistedItems, command);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
import {
ApiServiceLevelEnum,
ContentIssue,
ControlValuesLevelEnum,
DigestUnitEnum,
RuntimeIssue,
StepContentIssueEnum,
StepCreateAndUpdateKeys,
StepIssue,
StepIssueEnum,
StepIssues,
StepIssuesDto,
StepTypeEnum,
UserSessionData,
WorkflowIssueTypeEnum,
WorkflowResponseDto,
WorkflowStatusEnum,
} from '@novu/shared';
import {
ControlValuesRepository,
NotificationStepEntity,

NotificationTemplateRepository,
OrganizationEntity,
OrganizationRepository,
} from '@novu/dal';
import { ControlValuesRepository, NotificationStepEntity, NotificationTemplateRepository } from '@novu/dal';
import { Injectable } from '@nestjs/common';
import { MAX_DESCRIPTION_LENGTH, MAX_TAG_ELEMENTS, WorkflowInternalResponseDto } from '@novu/application-generic';

Expand Down Expand Up @@ -122,27 +109,6 @@ export class PostProcessWorkflowUpdate {
return stepIdToIssues;
}

private async getValues(
_stepId: string,
_workflowId: string,
_environmentId: string,
_organizationId: string
): Promise<Record<string, unknown> | null> {
const controlValuesEntity = await this.controlValuesRepository.findOne({
_environmentId,
_organizationId,
_workflowId,
_stepId,
level: ControlValuesLevelEnum.STEP_CONTROLS,
});

if (!Object.keys(controlValuesEntity?.controls || {}).length) {
return null;
}

return controlValuesEntity?.controls ?? null;
}

private async validateWorkflow(
command: PostProcessWorkflowUpdateCommand
): Promise<Record<keyof WorkflowResponseDto, RuntimeIssue[]>> {
Expand Down

0 comments on commit d9a6cb7

Please sign in to comment.