feat(observations): add observations.controller
This commit is contained in:
parent
f2733c6e72
commit
8db3ccf300
1 changed files with 24 additions and 0 deletions
24
src/observations/observations.controller.ts
Normal file
24
src/observations/observations.controller.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { Body, Controller, Get, Post, Query } from '@nestjs/common';
|
||||
import { CurrentSession } from '../auth/session.decorator';
|
||||
import type { AuthenticatedSession } from '../auth/tenant.guard';
|
||||
import { CreateObservationDto } from './dto';
|
||||
import { ObservationsService } from './observations.service';
|
||||
|
||||
@Controller('observations')
|
||||
export class ObservationsController {
|
||||
constructor(private readonly observationsService: ObservationsService) {}
|
||||
|
||||
@Get()
|
||||
list(
|
||||
@CurrentSession() session: AuthenticatedSession,
|
||||
@Query('subjectType') subjectType?: string,
|
||||
@Query('subjectId') subjectId?: string,
|
||||
) {
|
||||
return this.observationsService.list(session, subjectType, subjectId);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@CurrentSession() session: AuthenticatedSession, @Body() dto: CreateObservationDto) {
|
||||
return this.observationsService.create(session, dto);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue