Skip to content

Commit 93c5b78

Browse files
committed
chore: convert map to for each loop
1 parent ed85699 commit 93c5b78

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type ExpandDataType =
3434
success: true;
3535
}
3636
| {
37-
success: false;
3837
message: string;
38+
success: false;
3939
};
4040

4141
@Injectable()
@@ -166,7 +166,7 @@ export class InstrumentRecordsService {
166166
instruments.set(record.instrumentId, instrument);
167167
}
168168
for (const [measureKey, measureValue] of Object.entries(record.computedMeasures)) {
169-
if (!measureValue) {
169+
if (measureValue == null) {
170170
continue;
171171
}
172172

@@ -191,7 +191,7 @@ export class InstrumentRecordsService {
191191

192192
if (Array.isArray(measureValue) && measureValue.length >= 1) {
193193
const arrayResult = this.expandData(measureValue);
194-
arrayResult.map((arrayEntry: ExpandDataType) => {
194+
arrayResult.forEach((arrayEntry: ExpandDataType) => {
195195
if (!arrayEntry.success) throw new Error(arrayEntry.message);
196196
data.push({
197197
groupId: record.subject.groupIds[0] ?? DEFAULT_GROUP_NAME,

0 commit comments

Comments
 (0)