Added a basic import controller

ref #22
This commit is contained in:
Nicolai Ort 2020-12-16 18:20:31 +01:00
parent 39b932a81c
commit 1b1f8f2b09
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
import { Body, ContentType, Controller, Post } from 'routing-controllers';
import { OpenAPI } from 'routing-controllers-openapi';
@Controller('/import')
//@Authorized("IMPORT:read")
export class ImportController {
// private runnerRepository: Repository<Runner>;
/**
* Gets the repository of this controller's model/entity.
*/
constructor() {
//this.runnerRepository = getConnectionManager().get().getRepository(Runner);
}
@Post()
@ContentType("text/csv")
@OpenAPI({ description: "Create new runners based on a csv file" })
async post(@Body() body: any) {
console.log(body)
return body;
}
}