Use new projects API
This commit is contained in:
parent
11bca4cf53
commit
8bf483b334
24 changed files with 141 additions and 222 deletions
|
@ -7,18 +7,18 @@ using System.Linq;
|
|||
namespace Website.Controllers {
|
||||
public class HomeController : Controller {
|
||||
private readonly IBlogApi _blogApi;
|
||||
private readonly GitServerApi _api;
|
||||
private readonly IGitApi _api;
|
||||
|
||||
public HomeController(IBlogApi blogApi, GitServerApi api) {
|
||||
public HomeController(IBlogApi blogApi, IGitApi api) {
|
||||
_api = api;
|
||||
_blogApi = blogApi;
|
||||
}
|
||||
|
||||
public async Task<IActionResult> Index() {
|
||||
var post = await _blogApi.GetLatestPostAsync();
|
||||
var repo = (await _api.GetRepositories()).First();
|
||||
var branch = (await _api.GetBranches(repo.Name)).First();
|
||||
var commit = await _api.GetCommit(repo.Name, branch.Commit.Id);
|
||||
var repo = (await _api.GetRepositories("rob")).First();
|
||||
var branch = (await _api.GetBranches("rob", repo.Name)).First();
|
||||
var commit = await _api.GetCommit("rob", repo.Name, branch.Commit.Id);
|
||||
|
||||
var model = new HomeViewModel {
|
||||
BlogPost = new BlogPostViewModel(post, false),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue