Compare commits

..

No commits in common. "7b948f0380e6cc8e3d4a8b2ef54ffa34931d7f07" and "3a84cc8ef56c20fce74707f0aa9df7f120ee693e" have entirely different histories.

View File

@ -8,23 +8,17 @@ import {
Delete, Delete,
} from "routing-controllers"; } from "routing-controllers";
import { OpenAPI } from "routing-controllers-openapi"; import { OpenAPI } from "routing-controllers-openapi";
import { getConnection, Repository } from "typeorm";
import { Track } from "../models/Track";
@JsonController("/track") @JsonController()
export class TrackController { export class TrackController {
private repo(): Repository<Track> {
return getConnection().getRepository(Track);
}
@Get("/track") @Get("/track")
async getAll() { getAll() {
return await this.repo().find(); return "This action returns all users";
} }
@Get("/track/:id") @Get("/track/:id")
async getOne(@Param("id") id: number) { getOne(@Param("id") id: number) {
return await this.repo().findOne({ id: id }); return "This action returns user #" + id;
} }
@Post("/track") @Post("/track")