unit tests and pkg version commits
This commit is contained in:
parent
55e407d951
commit
f6fa7a0ec9
17 changed files with 553 additions and 89 deletions
|
|
@ -10,17 +10,13 @@ namespace isnd.Controllers
|
|||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
private readonly ApplicationDbContext _dbContext;
|
||||
private readonly IHostingEnvironment _env;
|
||||
private readonly IUnleash _unleashĈlient;
|
||||
|
||||
public HomeController(
|
||||
ApplicationDbContext dbContext,
|
||||
IUnleash unleashĈlient,
|
||||
ILogger<HomeController> logger)
|
||||
IUnleash unleashĈlient)
|
||||
{
|
||||
_logger = logger;
|
||||
_dbContext = dbContext;
|
||||
_unleashĈlient = unleashĈlient;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ using NuGet.Versioning;
|
|||
using isnd.Data;
|
||||
using isnd.Helpers;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using isnd.Data.Catalog;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
|
|
@ -39,6 +40,12 @@ namespace isnd.Controllers
|
|||
_logger.LogError("403 : no api-key");
|
||||
return Unauthorized();
|
||||
}
|
||||
Commit commit = new Commit
|
||||
{
|
||||
Action = PackageAction.PublishPackage,
|
||||
TimeStamp = DateTime.Now
|
||||
};
|
||||
_dbContext.Commits.Add(commit);
|
||||
|
||||
foreach (IFormFile file in Request.Form.Files)
|
||||
{
|
||||
|
|
@ -93,7 +100,8 @@ namespace isnd.Controllers
|
|||
{
|
||||
Id = pkgid,
|
||||
Description = pkgdesc,
|
||||
OwnerId = apikey.UserId
|
||||
OwnerId = apikey.UserId,
|
||||
LatestVersion = commit
|
||||
};
|
||||
_dbContext.Packages.Add(package);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue