public async Task <Node> SecureGetAsync(string id) { var request = $"{API_URL}?id={id}"; var items = await AuthorizedHttpClient.GetFromJsonAsync <Node[]>(request); return(items.FirstOrDefault()); }
public async Task <Message[]> GetAsync(string groupId, int currentPage) { var request = $"{API_URL}?groupId={groupId}"; var messages = await AuthorizedHttpClient.GetFromJsonAsync <Message[]>(request); messages.ToList().ForEach(async m => m.Username = await _userService.GetUserNameAsync(m.CreatedBy)); return(messages); }
private async Task LoadPromotions() { try { this.IsLoading = true; this.AuthorizedHttpClient = this.HttpClientService.CreateAuthorizedClient(); this.AllPromotions = await AuthorizedHttpClient.GetFromJsonAsync <PromotionModel[]>("api/Promotion/ListPromotions"); } catch (Exception ex) { await ToastifyService.DisplayErrorNotification(ex.Message); } finally { IsLoading = false; } }
public async Task <bool> AllowedAsync(string loggedInUserId, string createdBy, string module, string type, string action) { if (!string.IsNullOrEmpty(loggedInUserId) && loggedInUserId == createdBy) { return(true); } if (!string.IsNullOrEmpty(loggedInUserId)) { var request = $"{API_URL}?module={module}&type={type}&action={action}"; return(await AuthorizedHttpClient.GetFromJsonAsync <bool>(request)); } else { var request = $"{API_URL}/GuestAllowed?module={module}&type={type}&action={action}"; return(await PublicHttpClient.GetFromJsonAsync <bool>(request)); } }
public async Task <Category> GetByNameAsync(string name, string module) { var request = $"{API_URL}/GetByName?name={name}&module={module}"; return(await AuthorizedHttpClient.GetFromJsonAsync <Category>(request)); }
public async Task <GroupMember[]> SecureGetGroupMembersAsync(string groupId) { var request = $"{API_URL}/GetMembers?groupId={groupId}"; return(await AuthorizedHttpClient.GetFromJsonAsync <GroupMember[]>(request)); }
public async Task <Group> SecureGetByKeyAsync(string key) { var request = $"{API_URL}/GetByKey?key={key}"; return(await AuthorizedHttpClient.GetFromJsonAsync <Group>(request)); }
public async Task <Group[]> SecureGetAllAsync(string module) { var request = $"{API_URL}/GetAll?module={module}"; return(await AuthorizedHttpClient.GetFromJsonAsync <Group[]>(request)); }
public async Task <Group> SecureGetAsync(string id) { var request = $"{API_URL}?id={id}"; return(await AuthorizedHttpClient.GetFromJsonAsync <Group>(request)); }
public async Task <Invitation[]> GetAllAsync() { var request = $"{API_URL}/GetAll"; return(await AuthorizedHttpClient.GetFromJsonAsync <Invitation[]>(request)); }