Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(EditGuildItemViewModel model)
        {
            if (ModelState.IsValid)
            {
                await HttpClientHelper.ClientBot().GetGuildAsync(model.Id).Result.UpdateAsync();

                TempData.Add("success-msg", "Invite sent to user.");
                return(PartialView("_Edit", model));
            }
            return(PartialView("_Edit", new EditGuildItemViewModel()));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(ulong Id)
        {
            currentGuildId = Id;
            var result = await HttpClientHelper.ClientBot().GetGuildAsync(Id);

            var listy = new List <GuildUserViewModel>
            {
                new GuildUserViewModel()
                {
                    Id = HttpClientHelper.CurrentUser().Id, Name = HttpClientHelper.CurrentUser().Username, Avatar = HttpClientHelper.CurrentUser().GetAvatarUrl()
                }
            };
            var model = new EditGuildItemViewModel {
                Id = Id, Name = result.Name, guildUsers = listy
            };

            return(PartialView("_Edit", model));
        }