Skip to content

Commit

Permalink
debug(answers): remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
edward3sc committed Feb 25, 2025
1 parent 2f91b97 commit 621f59e
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions src/answers/answers.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,8 @@ export class AnswersController {
) {
const { template } = request;

this.logger.log('REQUEST', JSON.stringify(request.readableObjectMode));

const userPosition = fields.userPosition ?? [];

this.logger.log('CREATING REPORT');
this.logger.log('FIELDS', JSON.stringify(fields));
this.logger.log(
'FILE ARRAY',
fileArray?.length,
fileArray?.map((file) => file.fieldname),
);
this.logger.log(
'TEMPLATE',
template.id,
template.questions?.map((question) => question.name),
);
this.logger.log(`File is ${request.file?.fieldname}`);
this.logger.log(`Files are ${request.files?.length}`);

// This groups the file uploads by fieldname
const fileGroups = fileArray?.reduce((acc, file) => {
const questionName = file.fieldname;
Expand Down Expand Up @@ -139,21 +122,13 @@ export class AnswersController {
}

if (question.type === QuestionType.AUDIO) {
this.logger.log('QUESTION TYPE IS AUDIO');
const [file] = files;
const isPublic = fields.publicFiles?.includes(file.originalname);
this.logger.log(
'UPLOADING FILE',
file.path,
file.originalname,
isPublic,
);
const fileUrl = await this.s3Service.uploadFile({
filePath: file.path,
fullFileName: file.originalname,
isPublic,
});
this.logger.log('UPLOADED FILE', fileUrl);
return answer.responses.push({
name: question.name,
value: { url: fileUrl, isPublic },
Expand Down Expand Up @@ -186,8 +161,6 @@ export class AnswersController {
`${question.label[answer.language]} (${question.name}) required`,
);

this.logger.log('ANSWERING QUESTION', name);

await addResponseOrFail(question);

if (!question.childQuestions) continue;
Expand Down

0 comments on commit 621f59e

Please sign in to comment.