diff --git a/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts b/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts index c55cc489a2..8a3f87dbc7 100644 --- a/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts +++ b/backend/packages/Upgrade/src/api/DTO/ExperimentDTO.ts @@ -190,12 +190,14 @@ class ConditionPayloadValidator { public payload: PayloadValidator; @IsNotEmpty() - @IsString() - public parentCondition: string; + @ValidateNested() + @Type(() => ConditionValidator) + public parentCondition: ConditionValidator; @IsOptional() - @IsString() - public decisionPoint?: string; + @ValidateNested() + @Type(() => PartitionValidator) + public decisionPoint?: PartitionValidator; } class MetricValidator { diff --git a/backend/packages/Upgrade/src/api/services/ExperimentService.ts b/backend/packages/Upgrade/src/api/services/ExperimentService.ts index fb8e3bb87a..815a9b2199 100644 --- a/backend/packages/Upgrade/src/api/services/ExperimentService.ts +++ b/backend/packages/Upgrade/src/api/services/ExperimentService.ts @@ -1265,8 +1265,8 @@ export class ExperimentService { id: conditionPayload.id, payloadType: conditionPayload.payload.type, payloadValue: conditionPayload.payload.value, - parentCondition: conditions.find((doc) => doc.id === conditionPayload.parentCondition), - decisionPoint: partitions.find((doc) => doc.id === conditionPayload.decisionPoint), + parentCondition: conditions.find((doc) => doc.id === conditionPayload.parentCondition.id), + decisionPoint: partitions.find((doc) => doc.id === conditionPayload.decisionPoint.id), }; return conditionPayloadToReturn; })) || diff --git a/frontend/projects/upgrade/src/app/core/experiment-design-stepper/experiment-design-stepper.service.ts b/frontend/projects/upgrade/src/app/core/experiment-design-stepper/experiment-design-stepper.service.ts index baa5e09870..5f37e8a457 100644 --- a/frontend/projects/upgrade/src/app/core/experiment-design-stepper/experiment-design-stepper.service.ts +++ b/frontend/projects/upgrade/src/app/core/experiment-design-stepper/experiment-design-stepper.service.ts @@ -336,8 +336,8 @@ export class ExperimentDesignStepperService { conditionPayloads.push({ id: payloadRowData.id || uuidv4(), payload: { type: PAYLOAD_TYPE.STRING, value: payloadRowData.payload }, - parentCondition: parentCondition.id, - decisionPoint: decisionPoint.id, + parentCondition: parentCondition, + decisionPoint: decisionPoint, }); });