Get git projects from Gogs

This commit is contained in:
Robert Marshall 2020-01-03 17:19:50 +00:00
parent 9fd9beb860
commit 292d7729f2
9 changed files with 122 additions and 10 deletions

View file

@ -0,0 +1,19 @@
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Website.Data;
namespace Website.ViewComponents {
public class ProjectNavigationViewComponent :ViewComponent {
private readonly GitServerApi _api;
public ProjectNavigationViewComponent(GitServerApi api) {
_api = api;
}
public async Task<IViewComponentResult> InvokeAsync() {
var repositories = await _api.GetRepositories();
return View(repositories.Take(5));
}
}
}