diff --git a/.drone.yml b/.drone.yml index d86e2e8..4b40ba2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -52,7 +52,7 @@ steps: IMAGENAME: postgres:latest CONTAINERNAME: postgresapi COMMAND: create - OVERWRITE: false + OVERWRITE: true PRIVATE: false ADMINS: lucasevard,emrekartal,arthurvalin,lucasdelanier CODEFIRST_CLIENTDRONE_ENV_POSTGRES_ROOT_PASSWORD: diff --git a/Sources/src/main/kotlin/allin/routing/BetRouter.kt b/Sources/src/main/kotlin/allin/routing/BetRouter.kt index 5653e3f..26d2206 100644 --- a/Sources/src/main/kotlin/allin/routing/BetRouter.kt +++ b/Sources/src/main/kotlin/allin/routing/BetRouter.kt @@ -34,18 +34,7 @@ fun Application.BetRouter() { betDataSource.getBetById(id)?.let { call.respond(HttpStatusCode.Conflict, ApiMessage.BetAlreadyExist) } ?: run { - val betWithId = Bet( - id = id, - theme = bet.theme, - sentenceBet = bet.sentenceBet, - status = bet.status, - type = bet.type, - endRegistration = bet.endRegistration, - endBet = bet.endBet, - isPrivate = bet.isPrivate, - response = bet.response, - createdBy = username - ) + val betWithId = bet.copy(id = id, createdBy = username) betDataSource.addBet(betWithId) call.respond(HttpStatusCode.Created, betWithId) }