@@ -37,7 +37,9 @@ export class TrackController {
|
||||
@OnUndefined(TrackNotFoundError)
|
||||
@OpenAPI({ description: "Returns a track of a specified id (if it exists)" })
|
||||
async getOne(@Param('id') id: number) {
|
||||
return new ResponseTrack(await this.trackRepository.findOne({ id: id }));
|
||||
let track = await this.trackRepository.findOne({ id: id });
|
||||
if (!track) { throw new TrackNotFoundError(); }
|
||||
return new ResponseTrack(track);
|
||||
}
|
||||
|
||||
@Post()
|
||||
|
||||
Reference in New Issue
Block a user