public async Task <ActionResult <Keep> > CreateKeep([FromBody] Keep newKeep) { try { Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>(); newKeep.CreatorId = userInfo.Id; Keep created = _ks.CreateKeep(newKeep); created.Creator = userInfo; return(Ok(created)); } catch (System.Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <Keep> CreateKeep([FromBody] Keep newKeep) { newKeep.UserId = HttpContext.User.FindFirstValue("Id"); return(Ok(_service.CreateKeep(newKeep))); }