zwischenstand

This commit is contained in:
Naumann 2020-06-04 13:43:01 +02:00
parent 8d81ab4843
commit bd4f034d7b
4 changed files with 6 additions and 4 deletions

View file

@ -68,12 +68,12 @@ namespace BuecherwurmAPI.Controllers
return Ok(lend); return Ok(lend);
} }
//PATCH api/leihvorgang/{id} //PUT api/leihvorgang/{id}
[HttpPut("{id}")] [HttpPut("{id}")]
public ActionResult LendPatchById(long id, LendPost lend) public ActionResult LendPatchById(long id, LendPost lend)
{ {
_repository.insertLendReturningId(id, lend); var lendPatch = _repository.insertLendReturningId(id, lend);
return Ok(); return Ok(lendPatch);
} }
} }
} }

Binary file not shown.

View file

@ -149,7 +149,7 @@ namespace BuecherwurmAPI.Models
command.Parameters.Add(new SqliteParameter("@LendTime", book.LendTime)); command.Parameters.Add(new SqliteParameter("@LendTime", book.LendTime));
command.Parameters.Add(new SqliteParameter("@LendType", book.LendType)); command.Parameters.Add(new SqliteParameter("@LendType", book.LendType));
var success = command.ExecuteNonQuery(); command.ExecuteNonQuery();
return id; return id;
} }

View file

@ -118,10 +118,12 @@ namespace BuecherwurmAPI.Models
if (success == 1) if (success == 1)
{ {
command.CommandText = @"SELECT last_insert_rowid()";
return (long)command.ExecuteScalar(); return (long)command.ExecuteScalar();
} }
return -1; return -1;
} }
} }