Skip to content

Commit

Permalink
fix duplicate implementation after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
danoswaltCL committed Oct 2, 2023
1 parent e57d9ae commit 467f262
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,54 +653,6 @@ export class ExperimentClientController {
});
}


/**
* @swagger
* /log/caliper:
* post:
* description: Post Caliper format log data
* consumes:
* - application/json
* parameters:
* - in: body
* name: data
* required: true
* description: User Document
* tags:
* - Client Side SDK
* produces:
* - application/json
* responses:
* '200':
* description: Log data
* '500':
* description: null value in column "id\" of relation \"experiment_user\" violates not-null constraint
*/
@Post('log/caliper')
public async caliperLog(
@Body({ validate: { validationError: { target: false, value: false } } })
@Req()
request: AppRequest,
envelope: CaliperLogEnvelope
): Promise<Log[]> {
let result = envelope.data.map(async log => {
// getOriginalUserDoc call for alias
const experimentUserDoc = await this.getUserDoc(log.object.assignee.id, request.logger);
if (experimentUserDoc) {
// append userDoc in logger
request.logger.child({ userDoc: experimentUserDoc });
request.logger.info({ message: 'Got the original user doc' });
}
return this.experimentAssignmentService.caliperDataLog(log, {
logger: request.logger,
userDoc: experimentUserDoc,
});
});

const logsToReturn = await Promise.all(result);
return flatten(logsToReturn);
}

/**
* @swagger
* /log/caliper:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,53 +612,6 @@ export class ExperimentClientController {
});
}

/**
* @swagger
* /log/caliper:
* post:
* description: Post Caliper format log data
* consumes:
* - application/json
* parameters:
* - in: body
* name: data
* required: true
* description: User Document
* tags:
* - Client Side SDK
* produces:
* - application/json
* responses:
* '200':
* description: Log data
* '500':
* description: null value in column "id\" of relation \"experiment_user\" violates not-null constraint
*/
@Post('log/caliper')
public async caliperLog(
@Body({ validate: { validationError: { target: false, value: false } } })
@Req()
request: AppRequest,
envelope: CaliperLogEnvelope
): Promise<Log[]> {
let result = envelope.data.map(async log => {
// getOriginalUserDoc call for alias
const experimentUserDoc = await this.getUserDoc(log.object.assignee.id, request.logger);
if (experimentUserDoc) {
// append userDoc in logger
request.logger.child({ userDoc: experimentUserDoc });
request.logger.info({ message: 'Got the original user doc' });
}
return this.experimentAssignmentService.caliperDataLog(log, {
logger: request.logger,
userDoc: experimentUserDoc,
});
});

const logsToReturn = await Promise.all(result);
return flatten(logsToReturn);
}

/**
* @swagger
* /log/caliper:
Expand Down

0 comments on commit 467f262

Please sign in to comment.