diff --git a/src/InternshipSystem.Api/Controllers/EditionController.cs b/src/InternshipSystem.Api/Controllers/EditionController.cs
index 0708c9b..40834d4 100644
--- a/src/InternshipSystem.Api/Controllers/EditionController.cs
+++ b/src/InternshipSystem.Api/Controllers/EditionController.cs
@@ -56,6 +56,33 @@ namespace InternshipSystem.Api.Controllers
return Ok(editions);
}
+ ///
+ /// Get accessible editions
+ ///
+ /// Editions accessible by the current user
+ /// This action is only available for authorized student
+ ///
+ ///
+ [HttpGet("{id}")]
+ [ProducesResponseType(StatusCodes.Status200OK)]
+ [ProducesResponseType(StatusCodes.Status401Unauthorized)]
+ [ProducesResponseType(StatusCodes.Status404NotFound)]
+ public async Task> GetEditionInfo(Guid id, CancellationToken token)
+ {
+ var edition =
+ await Context.Editions
+ .Where(e => e.Id == id)
+ .ProjectTo(Mapper.ConfigurationProvider)
+ .FirstOrDefaultAsync(token);
+
+ if (edition == null)
+ {
+ return NotFound();
+ }
+
+ return Ok(edition);
+ }
+
///
/// Get current edition's configuration
///
diff --git a/src/InternshipSystem.Api/Controllers/InternshipTypesController.cs b/src/InternshipSystem.Api/Controllers/InternshipTypesController.cs
index e14df07..9fa8ccb 100644
--- a/src/InternshipSystem.Api/Controllers/InternshipTypesController.cs
+++ b/src/InternshipSystem.Api/Controllers/InternshipTypesController.cs
@@ -28,7 +28,7 @@ namespace InternshipSystem.Api.Controllers
/// Get internship types available for current edition
///
/// List of internship types for current edition
- [HttpGet]
+ [HttpGet("current")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
@@ -88,7 +88,7 @@ namespace InternshipSystem.Api.Controllers
}
///
- /// Add or update internship type
+ /// Add or update internship type, only available for coordinator
///
/// Internship type updated successfully
/// Invalid internship type form
@@ -100,7 +100,7 @@ namespace InternshipSystem.Api.Controllers
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Authorize]
- public async Task UpdateInternshipType([FromBody] InternshipTypeFrom internshipTypeFrom, CancellationToken cancellationToken)
+ public async Task UpsertInternshipType([FromBody] InternshipTypeFrom internshipTypeFrom, CancellationToken cancellationToken)
{
var validator = new InternshipTypeFrom.Validator();
var validationResult = await validator.ValidateAsync(internshipTypeFrom, cancellationToken);
@@ -138,7 +138,7 @@ namespace InternshipSystem.Api.Controllers
}
await Context.SaveChangesAsync(cancellationToken);
- return Ok($"Internship type updated successfully");
+ return Ok();
}
///