Skip to content

Commit 6ca5713

Browse files
committed
use native set for instrument ids
1 parent 326e030 commit 6ca5713

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ export class InstrumentRecordsService {
132132
async exportRecords({ groupId }: { groupId?: string } = {}, { ability }: Required<EntityOperationOptions>) {
133133
const records = await this.queryRecordsRaw(ability, groupId);
134134

135-
const instrumentIds = [...new Set(records.map((r) => r.instrumentId))];
135+
const instrumentIds = new Set(records.map((r) => r.instrumentId));
136136

137137
const instrumentsArray = await Promise.all(
138-
instrumentIds.map((id) => this.instrumentsService.findById(id) as Promise<ScalarInstrument>)
138+
instrumentIds.values().map((id) => this.instrumentsService.findById(id) as Promise<ScalarInstrument>)
139139
);
140140

141141
const instruments = new Map(instrumentsArray.map((instrument) => [instrument.id, instrument]));

0 commit comments

Comments
 (0)