Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions apps/backend/src/factory/pdf/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,21 @@ const addTopicInformation = async (
);
const instruments = await instrumentDataSource.getInstrumentsByIds(ids);

const call = await callDataSource.getCallByAnswerIdProposal(
answer.answerId
);
const value = instrumentPickerAnswer(answer, instruments, call);
updatedAnswers.push({
...answer,
value,
});
if (answer.answerId !== null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also handle the type as well?

As per the type definition, answerId is non nullable. In the case, I would recommend to refine the type definition as well.

const call = await callDataSource.getCallByAnswerIdProposal(
answer.answerId
);
const value = instrumentPickerAnswer(answer, instruments, call);
updatedAnswers.push({
...answer,
value,
});
} else {
updatedAnswers.push({
...answer,
value: null,
});
}
} else {
updatedAnswers.push({
...answer,
Expand Down
Loading