Skip to content

Commit bccf67a

Browse files
committed
refactor: remove unused api call
1 parent 6c72e35 commit bccf67a

2 files changed

Lines changed: 0 additions & 23 deletions

File tree

apps/api/src/sessions/sessions.controller.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,4 @@ export class SessionsController {
3737
findByID(@Param('id') id: string, @CurrentUser('ability') ability: AppAbility): Promise<Session> {
3838
return this.sessionsService.findById(id, { ability });
3939
}
40-
41-
@ApiOperation({ description: 'Find Sessions by ID' })
42-
@Post('list')
43-
@RouteAccess({ action: 'read', subject: 'Session' })
44-
findSessionList(@Query('ids') ids: string[], @CurrentUser('ability') ability: AppAbility): Promise<Session[]> {
45-
const idArray = Array.isArray(ids) ? ids : (ids as string).split(',');
46-
return this.sessionsService.findSessionList(idArray, { ability });
47-
}
4840
}

apps/api/src/sessions/sessions.service.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,6 @@ export class SessionsService {
126126
return session;
127127
}
128128

129-
async findSessionList(ids: string[], { ability }: EntityOperationOptions = {}) {
130-
const sessionsArray = await Promise.all(
131-
ids.map(async (id) => {
132-
const session = await this.sessionModel.findFirst({
133-
where: { AND: [accessibleQuery(ability, 'read', 'Session')], id }
134-
});
135-
if (!session) {
136-
throw new NotFoundException(`Failed to find session with ID: ${id}`);
137-
}
138-
return session;
139-
})
140-
);
141-
return sessionsArray;
142-
}
143-
144129
/** Get the subject if they exist, otherwise create them */
145130
private async resolveSubject(subjectData: CreateSubjectData) {
146131
this.loggingService.debug({ message: 'Attempting to resolve subject', subjectData });

0 commit comments

Comments
 (0)