Exemple #1
0
        private async Task Add(ViewContact contact)
        {
            var response = await httpClient.GetAsync($"/api/Contacts/add/{contact.Contact.Id}");

            response.EnsureSuccessStatusCode();

            var json = await response.Content.ReadAsStringAsync();

            var contactViewModel = JsonConvert.DeserializeObject <ContactViewModel>(json);

            contact.UserAccepted = Shared.ReferentielTable.EnumUserAccepted.PENDING;
            await InvokeAsync(StateHasChanged);

            await NotificationClient.SendNotificationsToUser(contactViewModel.Notification, contact.UserId);
        }