feat: add admin tests read and update endpoints
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { Controller, Get, Param, ParseIntPipe } from '@nestjs/common';
|
||||
import { TestsService } from './providers/tests.service';
|
||||
import { Public } from '../auth/decorators/public.decorator';
|
||||
|
||||
@Controller('tests')
|
||||
export class TestsController {
|
||||
constructor(
|
||||
/**
|
||||
* Inject Tests Service
|
||||
*/
|
||||
private readonly testsService: TestsService,
|
||||
) {}
|
||||
|
||||
@Public()
|
||||
@Get()
|
||||
public async getAllTests() {
|
||||
return await this.testsService.userGetAll();
|
||||
}
|
||||
|
||||
@Public()
|
||||
@Get(':id')
|
||||
public async getTestById(@Param('id', ParseIntPipe) id: number) {
|
||||
return await this.testsService.userGetOne(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user