Skip to content

Commit c30748b

Browse files
committed
fix: do not compute regression model if less than three records
1 parent 6d87f74 commit c30748b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

apps/api/src/instrument-records/instrument-records.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ export class InstrumentRecordsService {
233233
where: { AND: [accessibleQuery(ability, 'read', 'InstrumentRecord'), { groupId }, { instrumentId }] }
234234
});
235235

236+
if (3 > records.length) {
237+
return {};
238+
}
239+
236240
const data: { [key: string]: [x: number[], y: number[]] } = {};
237241
for (const record of records) {
238242
const numericMeasures = pickBy(record.computedMeasures, isNumber);

0 commit comments

Comments
 (0)