public async Task <ActionResult <VaultKeep> > CreateVaultKeep([FromBody] VaultKeep newVK) { try { Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>(); newVK.CreatorId = userInfo.Id; return(Ok(_service.CreateVaultKeep(newVK, userInfo.Id))); } catch (System.Exception e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult <VaultKeep> > CreateVaultKeep([FromBody] VaultKeep newVaultKeep) { try { Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>(); newVaultKeep.CreatorId = userInfo.Id; VaultKeep created = _vks.CreateVaultKeep(newVaultKeep); created.Creator = userInfo; return(Ok(created)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <VaultKeep> CreateVaultKeep([FromBody] VaultKeep newVaultKeep) { newVaultKeep.UserId = HttpContext.User.FindFirstValue("Id"); return(Ok(_service.CreateVaultKeep(newVaultKeep))); }