Skip to content
Snippets Groups Projects

Topic/1176 current version api

Merged Marcel Nellesen requested to merge Topic/1176-currentVersionApi into Product/745-currentVersions
Files
2
using Coscine.Configuration;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.Linq;
@@ -10,6 +10,7 @@ namespace Coscine.Api.Version.Controllers
/// <summary>
/// This controller represents the actions which can be taken with a version object.
/// </summary>
[Authorize]
public class VersionController : Controller
{
private readonly IConfiguration _configuration;
@@ -19,7 +20,7 @@ namespace Coscine.Api.Version.Controllers
/// VersionController specifying the configuration.
/// </summary>
/// <param name="logger"></param>
public VersionController(ILogger<VersionController> logger)
public VersionController()
{
_configuration = Program.Configuration;
_defaultVersions = new List<string> { "apis", "apps", "dlls", "scripts", "sharepoint", "cron" };
@@ -96,14 +97,14 @@ namespace Coscine.Api.Version.Controllers
return BadRequest("Cannot search for empty values.");
}
var Infos = GetEntries(applicationType);
var infos = GetEntries(applicationType);
if(Infos == null)
if(infos == null)
{
return NotFound($"Could not find: {applicationType}");
}
return Json(Infos);
return Json(infos);
}
}
}
Loading