This commit is contained in:
Kun Deng
2022-09-04 20:45:17 -04:00
parent d5944c470b
commit 05b5de0939
11 changed files with 7 additions and 128 deletions
+1 -15
View File
@@ -18,6 +18,7 @@ namespace Icarus.Controllers.V1
{
[Route("api/v1/song")]
[ApiController]
[Authorize]
public class SongController : BaseController
{
#region Fields
@@ -49,11 +50,6 @@ namespace Icarus.Controllers.V1
[HttpGet]
public IActionResult Get()
{
if (!IsTokenValid("read:song_details"))
{
return StatusCode(401, "Not allowed");
}
List<Song> songs = new List<Song>();
Console.WriteLine("Attemtping to retrieve songs");
_logger.LogInformation("Attempting to retrieve songs");
@@ -71,11 +67,6 @@ namespace Icarus.Controllers.V1
[HttpGet("{id}")]
public IActionResult Get(int id)
{
if (!IsTokenValid("read:song_details"))
{
return StatusCode(401, "Not allowed");
}
var context = new SongContext(_connectionString);
Song song = new Song { SongID = id };
@@ -92,11 +83,6 @@ namespace Icarus.Controllers.V1
[HttpPut("{id}")]
public IActionResult Put(int id, [FromBody] Song song)
{
if (!IsTokenValid("update:songs"))
{
return StatusCode(401, "Not allowed");
}
var context = new SongContext(_connectionString);
song.SongID = id;