Skip to content
Snippets Groups Projects
Commit bf3755c7 authored by Lucca Santangelo's avatar Lucca Santangelo
Browse files

asdasd

parent c1b636dc
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
...@@ -21,7 +21,7 @@ namespace Tsi1.Api.Controllers ...@@ -21,7 +21,7 @@ namespace Tsi1.Api.Controllers
_fileService = fileService; _fileService = fileService;
} }
[Authorize(Roles = UserTypes.Professor)] [Authorize(Roles = UserTypes.Professor + ", " + UserTypes.Student + ", " + UserTypes.FacultyAdmin)]
[HttpPost("Upload/{courseId}")] [HttpPost("Upload/{courseId}")]
public async Task<IActionResult> Upload(IFormFile file, int courseId) public async Task<IActionResult> Upload(IFormFile file, int courseId)
{ {
......
...@@ -110,6 +110,8 @@ namespace Tsi1.BusinessLayer.Services ...@@ -110,6 +110,8 @@ namespace Tsi1.BusinessLayer.Services
var course = await _context.Courses var course = await _context.Courses
.Include(x => x.Sections) .Include(x => x.Sections)
.ThenInclude(x => x.SectionItems)
.ThenInclude(x => x.SectionItemType)
.ThenInclude(x => x.SectionItems) .ThenInclude(x => x.SectionItems)
.ThenInclude(x => x.Forum) .ThenInclude(x => x.Forum)
.FirstOrDefaultAsync(x => x.Id == courseId); .FirstOrDefaultAsync(x => x.Id == courseId);
...@@ -140,6 +142,7 @@ namespace Tsi1.BusinessLayer.Services ...@@ -140,6 +142,7 @@ namespace Tsi1.BusinessLayer.Services
var automaticSubscriptionForums = course.Sections var automaticSubscriptionForums = course.Sections
.SelectMany(x => x.SectionItems) .SelectMany(x => x.SectionItems)
.Where(x => x.SectionItemType.Name == SectionItemTypes.Forum)
.Select(x => x.Forum) .Select(x => x.Forum)
.Where(x => x.IsAutomaticSubscription); .Where(x => x.IsAutomaticSubscription);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment