File

src/phrases/phrases.controller.ts

Prefix

phrases

Index

Methods

Methods

deletePhrase
deletePhrase(params: IsParameterWithIdOfTable)
Decorators :
@Delete(':id')
Parameters :
Name Type Optional
params IsParameterWithIdOfTable No
Returns : any
getPhrase
getPhrase()
Decorators :
@Public()
@Get()
Returns : any
savePhrase
savePhrase(modelPhrase: PhraseValidation)
Decorators :
@UseInterceptors(undefined)
@Post()
Parameters :
Name Type Optional
modelPhrase PhraseValidation No
Returns : any
updatePhrase
updatePhrase(modelPhrase: PhraseValidation, params)
Decorators :
@UseInterceptors(undefined)
@Put(':id')
Parameters :
Name Type Optional
modelPhrase PhraseValidation No
params No
Returns : any

import { Body, Controller, Get, Param, Post, Put, UseInterceptors,Delete } from '@nestjs/common';
import { Public } from 'src/auth/auth.controller';
import { PhrasesService } from './phrases.service';
import { FileInterceptor } from '@nestjs/platform-express';
import { IsParameterWithIdOfTable } from 'src/database/validation/parameter-validation';
import { PhraseValidation } from 'src/database/validation/phrase-validation';
import { SkipThrottle } from '@nestjs/throttler';

@SkipThrottle()
@Controller('phrases')
export class PhrasesController {

    constructor(private phraseService:PhrasesService){}

    //Exponer punto para el listado de todas los registro de frases 
    @Public()
    @Get()
    getPhrase():any{
        return this.phraseService.findAllPhrase();
    }

    //Exponer punto para almacenamiento de una nuevo registro de frases

    @UseInterceptors(FileInterceptor(''))
    @Post()
    savePhrase(@Body() modelPhrase:PhraseValidation):any{
        return this.phraseService.savePhrase(modelPhrase);
    }

    //Exponer punto para actualizar una frases de prensa mediante su id

    @UseInterceptors(FileInterceptor(''))
    @Put(':id')
    updatePhrase(@Body() modelPhrase:PhraseValidation, @Param() params):any{
        return this.phraseService.updatePhrase(params.id, modelPhrase);
    }

     //Exponer punto para remover una frases mediante su id 
     @Delete(':id')
     deletePhrase(@Param() params:IsParameterWithIdOfTable){
         return this.phraseService.deletePhrase(params.id);
     }
 
}

results matching ""

    No results matching ""