Transaction Support (#309)
* Added transactions to UnitOfWork and refactored code to use it. * This included blank UI fix from Kavita-webui
This commit is contained in:
parent
d2e444910d
commit
6e1b227e65
11 changed files with 168 additions and 124 deletions
|
|
@ -26,7 +26,7 @@ namespace API.Controllers
|
|||
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(username);
|
||||
_unitOfWork.UserRepository.Delete(user);
|
||||
|
||||
if (await _unitOfWork.Complete()) return Ok();
|
||||
if (await _unitOfWork.CommitAsync()) return Ok();
|
||||
|
||||
return BadRequest("Could not delete the user.");
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ namespace API.Controllers
|
|||
|
||||
_unitOfWork.UserRepository.Update(existingPreferences);
|
||||
|
||||
if (await _unitOfWork.Complete())
|
||||
if (await _unitOfWork.CommitAsync())
|
||||
{
|
||||
return Ok(preferencesDto);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue