create alumno
This commit is contained in:
@@ -1,34 +1,11 @@
|
||||
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
|
||||
import { Controller, Get, Param } from '@nestjs/common';
|
||||
import { SancionService } from './sancion.service';
|
||||
import { CreateSancionDto } from './dto/create-sancion.dto';
|
||||
import { UpdateSancionDto } from './dto/update-sancion.dto';
|
||||
|
||||
@Controller('sancion')
|
||||
export class SancionController {
|
||||
constructor(private readonly sancionService: SancionService) {}
|
||||
|
||||
@Post()
|
||||
create(@Body() createSancionDto: CreateSancionDto) {
|
||||
return this.sancionService.create(createSancionDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.sancionService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
findOne(@Param('id') id: number) {
|
||||
return this.sancionService.findOne(+id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateSancionDto: UpdateSancionDto) {
|
||||
return this.sancionService.update(+id, updateSancionDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.sancionService.remove(+id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Injectable, NotFoundException } from '@nestjs/common';
|
||||
import { CreateSancionDto } from './dto/create-sancion.dto';
|
||||
import { UpdateSancionDto } from './dto/update-sancion.dto';
|
||||
import { Sancion } from './entities/sancion.entity';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
@@ -9,15 +7,8 @@ import { Repository } from 'typeorm';
|
||||
export class SancionService {
|
||||
constructor(
|
||||
@InjectRepository(Sancion)
|
||||
private readonly sancionRepository: Repository<Sancion>
|
||||
){}
|
||||
create(createSancionDto: CreateSancionDto) {
|
||||
return 'This action adds a new sancion';
|
||||
}
|
||||
|
||||
findAll() {
|
||||
return `This action returns all sancion`;
|
||||
}
|
||||
private readonly sancionRepository: Repository<Sancion>,
|
||||
) {}
|
||||
|
||||
async findOne(id_sancion: number): Promise<Sancion> {
|
||||
const sancion = await this.sancionRepository.findOne({
|
||||
@@ -28,13 +19,5 @@ export class SancionService {
|
||||
}
|
||||
return sancion;
|
||||
}
|
||||
|
||||
update(id: number, updateSancionDto: UpdateSancionDto) {
|
||||
return `This action updates a #${id} sancion`;
|
||||
}
|
||||
|
||||
remove(id: number) {
|
||||
return `This action removes a #${id} sancion`;
|
||||
}
|
||||
}
|
||||
//IO
|
||||
//IO
|
||||
|
||||
Reference in New Issue
Block a user