Merge pull request 'get edition info by guid fix + add course info' (#50) from MoreEndpoints into master
This commit is contained in:
commit
eee47200f2
@ -66,12 +66,13 @@ namespace InternshipSystem.Api.Controllers
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[Authorize(Policy = Policies.RegisteredOnly)]
|
||||
[Authorize]
|
||||
public async Task<ActionResult<EditionConfigurationResult>> GetEditionsConfiguration(Guid id, CancellationToken token)
|
||||
{
|
||||
var edition =
|
||||
await Context.Editions
|
||||
.Include(e => e.AvailableSubjects)
|
||||
.Include(e => e.Course)
|
||||
.Where(e => e.Id.Equals(id))
|
||||
.ProjectTo<EditionConfigurationResult>(Mapper.ConfigurationProvider)
|
||||
.FirstOrDefaultAsync(token);
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using InternshipSystem.Core;
|
||||
using InternshipSystem.Core.Entity.Internship;
|
||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||
|
||||
@ -8,6 +9,7 @@ namespace InternshipSystem.Api.Result
|
||||
public class EditionConfigurationResult
|
||||
{
|
||||
public List<InternshipSubject> AvailableSubjects { get; set; }
|
||||
public Course Course { get; set; }
|
||||
public DateTime EditionStart { get; set; }
|
||||
public DateTime EditionFinish { get; set; }
|
||||
public DateTime ReportingStart { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user