Пример #1
0
        public async Task <ActionResult <Post> > Edit([FromBody] Post updated, int id)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                updated.Id      = id;
                updated.Creator = userInfo;
                return(Ok(_ps.Edit(updated, userInfo.Id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }