-
-
Save MrCube42/7345dd99b9f0475924ee6725bcf63c74 to your computer and use it in GitHub Desktop.
Injizierung des zuvor implementierten CompanionsService und dessen Verwendung innerhalb des Controllers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class CompanionsController { | |
constructor(private service: CompanionsService) {} | |
@Get() | |
async getAll(): Promise<Companion[]> { | |
return this.service.findAll(); | |
} | |
@Get(':id') | |
async getCompanionDetails(@Param('id') id: string): Promise<CompanionDetails> { | |
return this.service.findDetailsById(id); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment