Fixing sonar code quality recommendations

This commit is contained in:
Andrew Song 2020-12-25 15:08:40 -06:00
parent 4f93fef661
commit 2d066ea36c
5 changed files with 7 additions and 18 deletions

View file

@ -61,20 +61,7 @@ namespace API.Controllers
{
return Ok(await _libraryRepository.GetLibrariesAsync());
}
// Do I need this method?
// [HttpGet("library/{username}")]
// public async Task<ActionResult<IEnumerable<LibraryDto>>> GetLibrariesForUser(string username)
// {
// _logger.LogDebug("Method hit");
// var user = await _userRepository.GetUserByUsernameAsync(User.GetUsername());
//
// if (user == null) return BadRequest("Could not validate user");
//
// return Ok(await _libraryRepository.GetLibrariesForUserAsync(user));
// }
[Authorize(Policy = "RequireAdminRole")]
[HttpPut("update-for")]
public async Task<ActionResult<MemberDto>> UpdateLibrary(UpdateLibraryDto updateLibraryDto)

View file

@ -30,7 +30,6 @@ namespace API.Controllers
{
// NOTE: I think we should move this into library controller because it gets added to all admins
//_logger.Log(LogLevel.Debug, "Creating a new " + createLibraryDto.Type + " library");
var user = await _userRepository.GetUserByUsernameAsync(User.GetUsername());
if (user == null) return BadRequest("Could not validate user");