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 IMAGENAME: postgres:latest
CONTAINERNAME: postgresapi CONTAINERNAME: postgresapi
COMMAND: create COMMAND: create
OVERWRITE: false OVERWRITE: true
PRIVATE: false PRIVATE: false
ADMINS: lucasevard,emrekartal,arthurvalin,lucasdelanier ADMINS: lucasevard,emrekartal,arthurvalin,lucasdelanier
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_ROOT_PASSWORD: CODEFIRST_CLIENTDRONE_ENV_POSTGRES_ROOT_PASSWORD:

@ -34,18 +34,7 @@ fun Application.BetRouter() {
betDataSource.getBetById(id)?.let { betDataSource.getBetById(id)?.let {
call.respond(HttpStatusCode.Conflict, ApiMessage.BetAlreadyExist) call.respond(HttpStatusCode.Conflict, ApiMessage.BetAlreadyExist)
} ?: run { } ?: run {
val betWithId = Bet( val betWithId = bet.copy(id = id, createdBy = username)
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
)
betDataSource.addBet(betWithId) betDataSource.addBet(betWithId)
call.respond(HttpStatusCode.Created, betWithId) call.respond(HttpStatusCode.Created, betWithId)
} }

Loading…
Cancel
Save