Esempio n. 1
0
        public IHttpActionResult ChangeDescription(ChangeDescriptionModel m)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var image = ImageManager.ChangeDescription(User.Identity.GetUserId(), m.ImageId, m.NewDescription);

            PiChatHub.SendGroupChangeImageDescriptionNotification(image.GroupId, image.ImageId, image.Description);
            return(Ok());
        }
Esempio n. 2
0
        public async Task <IActionResult> ChangeDescription([FromBody] ChangeDescriptionModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (!MemberExists(model.AccountAddress))
            {
                return(NotFound());
            }

            Member member = _context.Members.Single(m => m.AccountAddress == model.AccountAddress);

            member.OrganizationDescription = model.OrganizationDescription;

            await _context.SaveChangesAsync();

            return(Ok());
        }