Scanstation "me" endpoint feature/157-scanstation_me #158

Merged
niggl merged 5 commits from feature/157-scanstation_me into dev 2021-03-17 15:52:05 +00:00
Showing only changes of commit 94001a48f1 - Show all commits

View File

@ -67,7 +67,7 @@ export class RunnerSelfServiceController {
@ResponseSchema(ResponseScanStation)
@ResponseSchema(ScanStationNotFoundError, { statusCode: 404 })
@OnUndefined(ScanStationNotFoundError)
@OpenAPI({ description: 'Lists basic information about the station whose token got provided. <br> This includes it\'s associated track. <br> Just set the ID to 0.', security: [{ "ScanApiToken": [] }] })
@OpenAPI({ description: 'Lists basic information about the station whose token got provided. <br> This includes it\'s associated track.', security: [{ "ScanApiToken": [] }] })
async getStationMe(@Req() req: Request) {
let scan = await this.stationRepository.findOne({ id: parseInt(req.headers["station_id"].toString()) }, { relations: ['track'] })
if (!scan) { throw new ScanStationNotFoundError(); }