From c4270b0839cb90be2be7ed498605eedb0f6e4d4d Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 29 Dec 2020 20:21:45 +0100 Subject: [PATCH] Adapted the new async behaviour ref #56 --- src/controllers/StatsClientController.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/StatsClientController.ts b/src/controllers/StatsClientController.ts index 80266bc..b291c41 100644 --- a/src/controllers/StatsClientController.ts +++ b/src/controllers/StatsClientController.ts @@ -1,7 +1,7 @@ import { Authorized, Body, Delete, Get, JsonController, OnUndefined, Param, Post } from 'routing-controllers'; import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi'; import { getConnectionManager, Repository } from 'typeorm'; -import { StatsClientNotFoundError } from '../errors/StatsClientErrors'; +import { StatsClientIdsNotMatchingError, StatsClientNotFoundError } from '../errors/StatsClientErrors'; import { TrackNotFoundError } from "../errors/TrackErrors"; import { CreateStatsClient } from '../models/actions/CreateStatsClient'; import { StatsClient } from '../models/entities/StatsClient'; @@ -53,7 +53,7 @@ export class StatsClientController { @Body({ validate: true }) client: CreateStatsClient ) { - let newClient = await this.clientRepository.save(client.toStatsClient()); + let newClient = await this.clientRepository.save(await client.toStatsClient()); let responseClient = new ResponseStatsClient(newClient); responseClient.key = newClient.key; return responseClient;