public async Task OnGetAsync(string meetingId, string currentReviewId = "") { await RefreshGrantApplicationsAsync(meetingId); if (currentReviewId == "") { currentReviewId = GrantApplications.FirstOrDefault()?.ReviewId ?? ""; } CurrentReviewId = currentReviewId; ActiveSession.Id = meetingId; }
private async Task RefreshGrantApplicationsAsync(string Id) { // get all applications for this committeeReviewId (Id) //e.g. string url = "https://myAzureWebsiteAzureFunctions.azurewebsites.net/api/GetAllCRMApplications"; string url = "https://grantsentitiesexample.azurewebsites.net/api/GetAllCRMApplications?code=wXQPG39aJZlZEQkxBN4C46NJQiefbdx7O1oiVQ39Cn9Tm0jmR4QTvA=="; #if DEBUG url = "http://localhost:7071/api/GetAllCRMApplications"; #endif var request = new GetDocketRequest { Id = Id }; HttpResponseMessage?response = await httpClient.PostAsJsonAsync(url, request); var listOfApplications = new List <DocketResponse>(); if (response != null && response.Content.Headers.ContentLength != 0) { listOfApplications = await response.Content.ReadFromJsonAsync <List <DocketResponse> >() ?? new List <DocketResponse>(); } GrantApplications.AddRange(listOfApplications); }