예제 #1
0
        public async Task <ActionResult <Recipe> > Update(int id, [FromBody] Recipe update)
        {
            try
            {
                Account userInfo = await HttpContext.GetUserInfoAsync <Account>();

                // _rService.Update(id, userInfo.Id);
                update.CreatorId = userInfo.Id;
                update.Id        = id;
                Recipe updated = _rService.Update(update);
                return(Ok(updated));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }