@@ -80,20 +80,20 @@ export class TestVariationsService {
8080 * @returns
8181 */
8282 async find (
83- createTestRequestDto : BaselineDataDto & { projectId : string ; sourceBranch ?: string }
83+ createTestRequestDto : BaselineDataDto & { projectId : string ; baselineBranchName ?: string }
8484 ) : Promise < TestVariation | null > {
8585 const project = await this . prismaService . project . findUnique ( { where : { id : createTestRequestDto . projectId } } ) ;
86- const mainBranch = createTestRequestDto . sourceBranch ?? project . mainBranchName ;
86+ const baselineBranchName = createTestRequestDto . baselineBranchName ?? project . mainBranchName ;
8787
88- const [ mainBranchTestVariation , currentBranchTestVariation ] = await Promise . all ( [
88+ const [ baselineBranchTestVariation , currentBranchTestVariation ] = await Promise . all ( [
8989 // search main branch variation
9090 this . findUnique ( {
9191 projectId : createTestRequestDto . projectId ,
92- branchName : mainBranch ,
92+ branchName : baselineBranchName ,
9393 ...getTestVariationUniqueData ( createTestRequestDto ) ,
9494 } ) ,
9595 // search current branch variation
96- createTestRequestDto . branchName !== mainBranch &&
96+ createTestRequestDto . branchName !== baselineBranchName &&
9797 this . findUnique ( {
9898 projectId : createTestRequestDto . projectId ,
9999 branchName : createTestRequestDto . branchName ,
@@ -102,14 +102,14 @@ export class TestVariationsService {
102102 ] ) ;
103103
104104 if ( ! ! currentBranchTestVariation ) {
105- if ( mainBranchTestVariation && mainBranchTestVariation . updatedAt > currentBranchTestVariation . updatedAt ) {
106- return mainBranchTestVariation ;
105+ if ( baselineBranchTestVariation && baselineBranchTestVariation . updatedAt > currentBranchTestVariation . updatedAt ) {
106+ return baselineBranchTestVariation ;
107107 }
108108 return currentBranchTestVariation ;
109109 }
110110
111- if ( ! ! mainBranchTestVariation ) {
112- return mainBranchTestVariation ;
111+ if ( ! ! baselineBranchTestVariation ) {
112+ return baselineBranchTestVariation ;
113113 }
114114 }
115115
0 commit comments