public async Task <ActionResult <Party> > Edit([FromBody] Party updated, int id) { try { Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>(); updated.CreatorId = userInfo.Id; updated.Id = id; updated.Creator = userInfo; return(Ok(_service.Edit(updated))); } catch (System.Exception err) { return(BadRequest(err.Message)); } }
public async Task <ActionResult <Party> > Edit(int id, [FromBody] Party editData) { try { Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>(); editData.Id = id; editData.Creator = userInfo; editData.creatorId = userInfo.Id; return(Ok(_service.Edit(editData, userInfo.Id))); } catch (Exception e) { return(BadRequest(e.Message)); } }