diff --git a/.vs/DeskHubSharp/v15/.suo b/.vs/DeskHubSharp/v15/.suo index 439d2ea..5205686 100644 Binary files a/.vs/DeskHubSharp/v15/.suo and b/.vs/DeskHubSharp/v15/.suo differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide index b8faaf4..3ec4c19 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm index 00c9850..01adc60 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal index 50d6117..2e66870 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal differ diff --git a/DeskHubSharp/BusinessLayer/Request.cs b/DeskHubSharp/BusinessLayer/Request.cs index 8e297aa..a2d6c89 100644 --- a/DeskHubSharp/BusinessLayer/Request.cs +++ b/DeskHubSharp/BusinessLayer/Request.cs @@ -15,8 +15,7 @@ namespace DeskHubSharp { // TODO: this is rudimentary, fix it // i.e. try catch statements\ - // TODO: find how to access a list index - // TODO: find how to access the deserialized + // TODO: Add BranchRequest function private string _apiEndpoint = "https://api.github.com/"; private string _query; @@ -34,7 +33,7 @@ namespace DeskHubSharp //} /// - /// Calls API for repo and user data an stores it in RepoList + /// Calls API for repo and basic user data /// /// public void SearchRequest() @@ -63,7 +62,7 @@ namespace DeskHubSharp } else { - RepoList.repoDetail = deserialized; + RequestList.repoDetail = deserialized; } } catch (Exception) @@ -95,7 +94,7 @@ namespace DeskHubSharp } else { - RepoList.userDetail = deserailized; + RequestList.userDetail = deserailized; } } @@ -107,5 +106,29 @@ namespace DeskHubSharp } + /// + /// Calls API for detailed branch data + /// + public void BranchRequest() + { + try + { + var client = new RestClient(_apiEndpoint); + + RestRequest requestUser = new RestRequest($"/repos/{RequestList.userDetail.login}/{_query}/branches", Method.GET); + + var response = client.Execute(requestUser); + string x = response.Content; + var deserailized = JsonConvert.DeserializeObject>(x); + + RequestList.branchDetail = deserailized; + } + catch (Exception) + { + ErrorWindow err = new ErrorWindow(); + err.txtblk_error.Text = "We couldn't gather user data. Please try again."; + } + } + } } diff --git a/DeskHubSharp/DeskHubSharp.csproj b/DeskHubSharp/DeskHubSharp.csproj index de886c3..3332ad6 100644 --- a/DeskHubSharp/DeskHubSharp.csproj +++ b/DeskHubSharp/DeskHubSharp.csproj @@ -72,6 +72,7 @@ MSBuild:Compile + @@ -132,7 +133,7 @@ - + diff --git a/DeskHubSharp/DetailWindow.xaml b/DeskHubSharp/DetailWindow.xaml index 71e3fd9..bab7521 100644 --- a/DeskHubSharp/DetailWindow.xaml +++ b/DeskHubSharp/DetailWindow.xaml @@ -5,12 +5,24 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:DeskHubSharp" mc:Ignorable="d" - Title="Detail - DeskHubSharp" Height="450" Width="800" ResizeMode="NoResize"> + Title="Detail - DeskHubSharp" Height="450" Width="400" ResizeMode="NoResize"> -