@@ -44,23 +44,38 @@ namespace Icarus.Controllers
|
||||
|
||||
albums = albumStoreContext.GetAlbums();
|
||||
|
||||
|
||||
return Ok(albums);
|
||||
if (albums.Count > 0)
|
||||
{
|
||||
return Ok(albums);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("{id}")]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
Album album = new Album();
|
||||
album.AlbumId = id;
|
||||
Album album = new Album
|
||||
{
|
||||
AlbumId = id
|
||||
};
|
||||
|
||||
AlbumStoreContext albumStoreContext = HttpContext
|
||||
.RequestServices
|
||||
.GetService(typeof(AlbumStoreContext)) as AlbumStoreContext;
|
||||
|
||||
album = albumStoreContext.GetAlbum(album);
|
||||
if (albumStoreContext.DoesAlbumExist(album))
|
||||
{
|
||||
album = albumStoreContext.GetAlbum(album);
|
||||
|
||||
return Ok(album);
|
||||
return Ok(album);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ namespace Icarus.Models.Context
|
||||
{
|
||||
album = ParseSingleData(reader);
|
||||
|
||||
if (album != null)
|
||||
if (album.Title != null)
|
||||
{
|
||||
_logger.Info($"Album {album.Title} exists");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user