Retourner transactions lors de leur insertion
Rendre disponible les id de transactions officiellement ajoutées lors d'un '201 Created' sur 'POST /v2/transactions http/1.1' dans le response body sous 'application/json: data.transactions'.
This commit is contained in:
parent
12d98cf302
commit
6f5b8733b6
3 changed files with 18 additions and 16 deletions
|
@ -96,15 +96,14 @@ func PostTransactions(c echo.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
rows, err := client.InsertTransactions(transactions)
|
||||
insertedTransactions, err := client.InsertTransactions(transactions)
|
||||
response.Data.Transactions = insertedTransactions
|
||||
if err != nil {
|
||||
response.Message = fmt.Sprintf("Error during client.InsertTransactions(): %s", err)
|
||||
|
||||
return c.JSON(statusCode, response)
|
||||
}
|
||||
|
||||
response.Data.RowsInserted = rows
|
||||
|
||||
statusCode = http.StatusCreated
|
||||
response.Message = "Insert successful"
|
||||
|
||||
|
|
Reference in a new issue