File tree Expand file tree Collapse file tree
apps/api/src/instrument-records Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import type { EntityOperationOptions } from '@/core/types';
2020import { GroupsService } from '@/groups/groups.service' ;
2121import { InstrumentsService } from '@/instruments/instruments.service' ;
2222import { SessionsService } from '@/sessions/sessions.service' ;
23- import type { CreateSubjectDto } from '@/subjects/dto/create-subject.dto' ;
23+ import { CreateSubjectDto } from '@/subjects/dto/create-subject.dto' ;
2424import { SubjectsService } from '@/subjects/subjects.service' ;
2525
2626import { InstrumentMeasuresService } from './instrument-measures.service' ;
@@ -276,6 +276,19 @@ export class InstrumentRecordsService {
276276 const createdSessionsArray : Session [ ] = [ ] ;
277277
278278 try {
279+ const subjectIdList = records . map ( ( record ) => {
280+ const { subjectId : subjectId } = record ;
281+
282+ const subjectToAdd : CreateSubjectDto = { id : subjectId } ;
283+
284+ return subjectToAdd ;
285+ } ) ;
286+
287+ // await this.subjectsService.createMany({
288+ // data: subjectIdList,
289+ // skipDuplicates: true
290+ // });
291+
279292 const preProcessedRecords = await Promise . all (
280293 records . map ( async ( record ) => {
281294 const { data : rawData , date, subjectId } = record ;
You can’t perform that action at this time.
0 commit comments