feat(sessions): add GET /sessions and DELETE /sessions/:id endpoints
This commit is contained in:
1 parent
238ce0289c
commit
49dd1aa14c
3 files changed
+52
No files matched your search
@@ -39,4 +39,12 @@ export class SessionService {
|
||||
findBySessionName(sessionName: string): Promise<SessionEntity | null> {
|
||||
return this.repo.findOneBy({ sessionName });
|
||||
}
|
||||
|
||||
findAll(): Promise<Pick<SessionEntity, 'id' | 'sessionName' | 'createdAt' | 'updatedAt'>[]> {
|
||||
return this.repo.find({ select: ['id', 'sessionName', 'createdAt', 'updatedAt'] });
|
||||
}
|
||||
|
||||
async remove(id: number): Promise<void> {
|
||||
await this.repo.delete(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user