Use new projects API
This commit is contained in:
parent
11bca4cf53
commit
8bf483b334
24 changed files with 141 additions and 222 deletions
16
Website/Data/GitApi.cs
Normal file
16
Website/Data/GitApi.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Website.Models.Git;
|
||||
|
||||
namespace Website.Data {
|
||||
public class GitApi : ApiClient, IGitApi {
|
||||
|
||||
public GitApi(HttpClient client) : base(client) {
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Repository>> GetRepositories(string user) => await Get<IEnumerable<Repository>>("repositories", new { user });
|
||||
public async Task<IEnumerable<Branch>> GetBranches(string user, string repository) => await Get<IEnumerable<Branch>>("branches", new {user, repository});
|
||||
public async Task<Commit> GetCommit(string user, string repository, string hash) => await Get<Commit>("commit", new {user, repository, hash});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue