From bd4f034d7b2f5dd56b47693e941677b0dde470d8 Mon Sep 17 00:00:00 2001 From: Naumann Date: Thu, 4 Jun 2020 13:43:01 +0200 Subject: [PATCH] zwischenstand --- Controllers/LendController.cs | 6 +++--- LongWormMemory.db | Bin 16384 -> 16384 bytes Models/KatalogModel.cs | 2 +- Models/LendModel.cs | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Controllers/LendController.cs b/Controllers/LendController.cs index 47a7c37..6f1d84d 100644 --- a/Controllers/LendController.cs +++ b/Controllers/LendController.cs @@ -68,12 +68,12 @@ namespace BuecherwurmAPI.Controllers return Ok(lend); } - //PATCH api/leihvorgang/{id} + //PUT api/leihvorgang/{id} [HttpPut("{id}")] public ActionResult LendPatchById(long id, LendPost lend) { - _repository.insertLendReturningId(id, lend); - return Ok(); + var lendPatch = _repository.insertLendReturningId(id, lend); + return Ok(lendPatch); } } } \ No newline at end of file diff --git a/LongWormMemory.db b/LongWormMemory.db index 80df6e6d145b0a6a57fb283e231256021930897f..394130a2b9eb7eb1e62b2acea3b4c0eb50e30b8e 100644 GIT binary patch delta 155 zcmZo@U~Fh$oFL6;I8nx#(QsozxE>Ry*5nC#itOxc42;g=oSPr&DKPRgFfcIl&0^x4 z#m~pz!zZ>`P=Jk(g};lTWwMlAg*cGGp)74%T*Sz$45Y;wnHU%&896754-O6%4i>W!5C#qedISw4lNvsF1ONa4e3KGCPLpUpDw7UBd=GR14I?8PJr@E3 V00CJ60h6gdIs^im2j!DtKPjlX843UZ diff --git a/Models/KatalogModel.cs b/Models/KatalogModel.cs index 5f9b390..e8a2d23 100644 --- a/Models/KatalogModel.cs +++ b/Models/KatalogModel.cs @@ -149,7 +149,7 @@ namespace BuecherwurmAPI.Models command.Parameters.Add(new SqliteParameter("@LendTime", book.LendTime)); command.Parameters.Add(new SqliteParameter("@LendType", book.LendType)); - var success = command.ExecuteNonQuery(); + command.ExecuteNonQuery(); return id; } diff --git a/Models/LendModel.cs b/Models/LendModel.cs index 62daeb4..f4407b9 100644 --- a/Models/LendModel.cs +++ b/Models/LendModel.cs @@ -118,10 +118,12 @@ namespace BuecherwurmAPI.Models if (success == 1) { + command.CommandText = @"SELECT last_insert_rowid()"; return (long)command.ExecuteScalar(); } return -1; + } }