#74: Add UserID to the Song model (#98)

* #74: Add UserID to the Song model

* #74: Added functionality to retrieve user id from the token

* #74: Songs will now contain the User Id when uploading

* Updated Readme and script to add migrations

* #74: Some cleanup
This commit was merged in pull request #98.
This commit is contained in:
Kun Deng
2024-06-19 15:41:55 -04:00
committed by GitHub
parent ebb15b7cdb
commit 562bc87822
25 changed files with 117 additions and 164 deletions
+2 -13
View File
@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Icarus.Models;
using Icarus.Database.Contexts;
@@ -41,11 +35,9 @@ public class AlbumController : BaseController
[HttpGet]
public IActionResult GetAlbums()
{
List<Album> albums = new List<Album>();
var albumContext = new AlbumContext(_connectionString);
albums = albumContext.Albums.ToList();
var albums = albumContext.Albums.ToList();
if (albums.Count > 0)
return Ok(albums);
@@ -56,10 +48,7 @@ public class AlbumController : BaseController
[HttpGet("{id}")]
public IActionResult GetAlbum(int id)
{
Album album = new Album
{
AlbumID = id
};
Album album = new Album{ AlbumID = id };
var albumContext = new AlbumContext(_connectionString);