fix api
continuous-integration/drone/push Build is passing Details

pull/8/head
Arthur VALIN 1 year ago
parent 8f9310a58d
commit 52d19d6fd9

@ -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:

@ -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)
}

Loading…
Cancel
Save