Skip to content

Commit d7a02c9

Browse files
committed
fix: use identity type to fix fowardREf services to work with swc compiling
1 parent c2b6c41 commit d7a02c9

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

apps/api/src/core/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ import type { AppAbility } from '@douglasneuroinformatics/libnest';
33
export type EntityOperationOptions = {
44
ability?: AppAbility;
55
};
6+
7+
//This indentity type is used as a quick fix to resolve the swc compiling issue with fowardRef nestjs services
8+
export type Identity<T> = T;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class InstrumentRecordsService {
4242
private readonly instrumentsService: InstrumentsService,
4343
private readonly sessionsService: SessionsService,
4444
@Inject(forwardRef(() => SubjectsService))
45-
private readonly subjectsService: SubjectsService
45+
private readonly subjectsService: InstanceType<typeof SubjectsService>
4646
) {}
4747

4848
async count(

apps/api/src/subjects/subjects.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { ConflictException, Injectable, NotFoundException } from '@nestjs/common
44
import type { Prisma } from '@prisma/client';
55

66
import type { EntityOperationOptions } from '@/core/types';
7-
import { InstrumentRecordsService } from '@/instrument-records/instrument-records.service';
87

98
import { CreateSubjectDto } from './dto/create-subject.dto';
109

0 commit comments

Comments
 (0)