import { Body , Controller , Get , Param , Patch , Post } from '@nestjs/common' ; import { Observable } from 'rxjs' ; import { CharacterIdDTO } from '../character/models' ; import { AbilityScoreService } from './ability-score.service' ; import { AbilityScoreDTO , AbilityScoreIdDTO , AbilityScoreInputDTO , AbilityScoreUpdateDTO , } from './models' ; @ Controller ( 'ability' ) export class AbilityScoresController { constructor ( private readonly abilityScoresService ) { } @ Get ( 'char/:id' ) getAbilityScoresByCharacterId ( @ Param ( ) charId ) { return this . abilityScoresService . getAbilityScoresByCharId ( charId ) ; } @ Get ( ':id' ) getAbilityScoreById ( @ Param ( ) abilityId ) { return this . abilityScoresService . getAbilityScoreById ( abilityId ) ; } @ Post ( 'new' ) insertOneAbilityScore ( @ Body ( ) abilityScore ) { return this . abilityScoresService . insertOneAbilityScore ( abilityScore ) ; } @ Post ( 'new/mass' ) insertManyAbilityScores ( @ Body ( ) abilities ) { return this . abilityScoresService . insertManyAbilityScores ( abilities ) ; } @ Patch ( 'update' ) updateOneAbilityScore ( @ Body ( ) abilityUpdate ) { return this . abilityScoresService . updateOneAbilityScore ( abilityUpdate ) ; } @ Patch ( 'update/mass' ) updateManyAbilityScores ( @ Body ( ) abilities ) { return this . abilityScoresService . updateManyAbilityScores ( abilities ) ; } }